clach04 / puren_tonbo

Plain text notes Tombo (chi) alternative, also supports, ccrypt, GnuPG (OpenPGP, gpg), OpenSSL AES-256-CBC, AES-256 ZIP AE-1/AE-2 and VimCrypt encrypted files. Integrates with VIM. WIP
https://pypi.org/project/puren-tonbo/
GNU Lesser General Public License v2.1
1 stars 0 forks source link

ptig - regression in search and escape #108

Open clach04 opened 6 months ago

clach04 commented 6 months ago

Two issues:

  1. find filename no longer includes encrypted files, example, f aesop

    • workaround 1, use the -e (or -k for encrypted only)) flag, example, f -e aesop
    • workaround 2, set search encryption mode, example, set enc
  2. find filename using search terms with spaces raise error, Too many search terms (use quotes). Example, f git scm

    • workaround, quote search term, example, f "git scm"

Sample session ptig: ? f git scm Too many search terms (use quotes)

Since fix/change https://github.com/clach04/puren_tonbo/commit/240ffdba2eeffe96dcc83e6b5ddaabe15cc3c770 find (filename only search) no longer searches for filenames with spaces without escaping. This is inconsistent with search/grep and a regression from previous behavior.

ptig

rg git scm
f git scm
f "git scm"

the later is the workaround. By default should not need to escape in ptig, defaults to literal mode.

clach04 commented 6 months ago

Looks like this is trigged by the use of command line argument stuffing, grep already has this (expected) behavior when passing args. For example:

ptig: ? rg git scm
Query time: 0.00 seconds
ptig: ? rg -i git scm
Too many search terms (use quotes)
ptig: ? rg -y git scm
Too many search terms (use quotes)
ptig: ? rg -y "git scm"
Query time: 0.00 seconds
ptig: ? rg -i -y "git scm"
Query time: 0.00 seconds

New filename find calls grep with command line args (for search filename only).

Idea, potentially stuff additional arguments into do_grep() as additional parameters to skip this trigger unless user has explicitly issued command line flags.