-
-
Notifications
You must be signed in to change notification settings - Fork 83
Description
Current Behavior
When finding and replacing text, there are currently two main highlight options: highlight.search and highlight.replace.
When I'm searching for text, this works pretty well:
However, when I'm replacing text, things look a bit odd.
The text being removed is still highlighted in the same DiffChanged neutral color, and the text being added is highlighted in DiffDelete (which is almost always red).
Expected Behavior
The current behavior for searching makes sense, and I wouldn't change it. However, when a replacement term is entered, I'd expect the new text to be highlighted in DiffAdd (usually green) and for the text being replaced to be highlighted in DiffDelete (usually red). This behaves more like a preview of what will happen when you replace the items.
In my editor, this change would look like the following:
It's subtle, but I think it's helpful.
Needed Config
In order to accomplish this, I think you need to split the current replace option into two options. Something like this:
highlight = {
ui = "String",
search = "DiffChange",
delete = "DiffDelete"
add = "DiffAdd"
},If you wanted to keep the existing option for backwards compatibility, something like this could also work:
highlight = {
ui = "String",
search = "DiffChange",
replaced = "DiffDelete"
replace = "DiffAdd"
},