lnav version
Compiled from current main
Describe the bug
As in the subject, if accidentally adding a :highlight for a string ending in whitespace, then :clear-highlight will be unable to remove it later on.
Definitely a very minor issue.
To Reproduce
Open any log file. Enter a string to :highlight , but introduce a space at the end. Now try to :clear-highlight choosing the string from the drop down. The drop down correctly shows the garbage blank space at the end, when you select it the right string (with the trailing whitespace) is filled in the command line, but the command returns error because the highlight does not exist.
And there is no amount of quoting I have attempted that correctly captures the string with the trailing space so that :clear-highlight really works.
Possible Fix
Alternatives would be :
- Do nothing. This is rather a corner case, and while it may be a valid use case to highlight a string ending in a blank (to not highlight when string is part of a longer word), the alternative that seems to work is using a pattern like "string\s" instead
- Fix at the time of entering the pattern : not allow a pattern to end in whitespace
- Fix at the time of clearing the highlight. Probably overkill
lnav version
Compiled from current main
Describe the bug
As in the subject, if accidentally adding a
:highlightfor a string ending in whitespace, then:clear-highlightwill be unable to remove it later on.Definitely a very minor issue.
To Reproduce
Open any log file. Enter a string to
:highlight, but introduce a space at the end. Now try to:clear-highlightchoosing the string from the drop down. The drop down correctly shows the garbage blank space at the end, when you select it the right string (with the trailing whitespace) is filled in the command line, but the command returns error because thehighlight does not exist.And there is no amount of quoting I have attempted that correctly captures the string with the trailing space so that
:clear-highlightreally works.Possible Fix
Alternatives would be :