forked from nschum/full-ack
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove ansi escape codes from ack output buffer
The purpose of removing the ansi escape sequences is to make it possible to properly search within the ack output buffer. For example, if I used full-ack to search for "set-key", and then wanted to search within the ack output buffer for "global-set-key", the search would always fail. The reason is that ansi esacpe sequences would be inserted by ack around all instances of "set-key". Full-ack marks this output as invisible, so you wouldn't see it, but it was there, and prevented searching within the output from working as expected. This required changing how we parse the ack output to extract file names, line numbers, and matches. Previously we used font-lock-defaults to enable regexp-based fontification of the ack output. The regexps used the ansi escape sequences to find the locations of file names, line numbers, and matches. With the ansi escape sequences stripped that would no longer work. We still use the ansi escape sequences, but we instead apply the faces as the sequences are being stripped out while processing the ack output. This is implemented in ack-parse-sgr-sequences, which is inspired by the ansi-color-apply function, used to process ansi escape sequences for shell mode. The end result is that everything works as it did before, except there's no more invisible text, so searching in the ack output buffer now works correctly.
- Loading branch information
Showing
1 changed file
with
137 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters