Genivia / ugrep

NEW ugrep 7.1: a more powerful, ultra fast, user-friendly, compatible grep. Includes a TUI, Google-like Boolean search with AND/OR/NOT, fuzzy search, hexdumps, searches (nested) archives (zip, 7z, tar, pax, cpio), compressed files (gz, Z, bz2, lzma, xz, lz4, zstd, brotli), pdfs, docs, and more
https://ugrep.com
BSD 3-Clause "New" or "Revised" License
2.66k stars 111 forks source link

[FR] add TUI syntax highlighting to the glob editor #443

Closed genivia-inc closed 3 days ago

genivia-inc commented 6 days ago

Add syntax highlighting to the TUI glob editor. Globs are edited in the TUI by pressing ALT-g (or Option-g with MacOS.)

For example, editing the C++ globs that are initially populated with ug -Q -tcpp should look like this:

image

Right now in v7.0, the glob editor syntax highlighting isn't showing up correctly, because the TUI is still in regex syntax highlighting mode.

Also, when viewing the help page with F1 or CTRL-Z, pressing ALT-g should jump right into the glob edit line instead of showing a message that globs can't be edited when viewing the help page.

genivia-inc commented 5 days ago

As I am aggressively experimenting with the TUI, I found a little glitch when a single directory is specified as the search target. When we Tab into it in the TUI, the listing is empty because a recursive search is not performed inside that directory. This happens because the target is a directory that we initially search at one level, not recursively. But when we Tab into it, then the TUI should temporarily enable recursive searching until we Shift-Tab out of it. This will be fixed as well.

In addition, the boolean search regex highlighting in the TUI isn't 100% satisfactory and can be improved.