Open
Conversation
Member
|
Looks great! Only thing is the replace doesn't work for me. :) Here's what I tried:
At which point I'm not sure why but nothing happens. |
Contributor
Author
|
OK, looks like the enter key is not triggering the button - you can tab into the Replace button and trigger it manually. I'll look into it. |
Contributor
Author
|
OK, that should be fixed. I've also added a commit which implements replacement text as after a bit more investigation I'm confident in the behaviour. This adds a dependency, which I've written for the purpose. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a simple implementation of a replace feature.
Find continues to work as before, but there is an additional replace line and button. Pressing the button, or hitting enter with the replace line focussed, does a replace.
No attempt is made to perform capture interpolation, e.g. of
$1(It's not hard, and I have all the necessary bits of code, but different editors have different behaviours so I want to separate out thatbikesheddingspecification discussion).One issue I have found is that the tab order is not stable. I don't know if I'm doing something wrong or whether this is a (mis)feature of the way blessed objects are created, where they specify their parents rather than being actively appended to them as you would with a DOM. It is usable, and always possible to tab to all the fields, but sometimes when hitting tab from the find field, you get the replace field, as you'd expect, and other times, you get the Replace button. I'm not able to solve this but I wonder if the react-blessed rewrite will take care of it.
Note that this renders #367 redundant.