-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Issue #11261: keep the search bar open #11996
Conversation
…as a result of clicking in the main editor. This is done by commenting out the code in line 256. The search bar will also close when the ESC key is pressed while the main editor has focus
…/automatically close * Add a close icon to the search bar (for completeness) * Fix escape key for in-editor searches * Remember last search phrase if no selection for in-editor searches
… until I can confirm with a Quebecois at work
👍 Awersome PR! |
src/search/FindReplace.js
Outdated
if (editor) { | ||
// Make note of the original query details | ||
var state = getSearchState(editor._codeMirror), | ||
qry = (findBar && state && state.parsedQuery) || "", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nitpick: this variable could be just query
Thanks @Denisov21 and @petetnt ! Will look into getting these fixed in the next few weeks :-) |
src/search/FindReplace.js
Outdated
@@ -695,6 +702,8 @@ define(function (require, exports, module) { | |||
findBar.close(); | |||
} | |||
} | |||
|
|||
editor.lastEditorSearchPosStr = ""; // Positions have shifted, so we abort the auto-next on findbar launch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No longer relevant - remove.
addresses #12280 |
Welp, how has this been left on the backburner for so long. Sorry about that @pldilley! If you could fix that one conflict so we can merge this in ASAP. Sorry again! |
@petetnt No problem, I have a bit of time this weekend, I'll retest it too to make sure that the behaviour hasn't changed. |
Bump. Is anyone working on this PR now? |
I'd appreciate this being incorporated if anyone has the time to iron out the conflicts |
Bumping again, as I get frustrated by this issue almost every time I use brackets. Please, can this be incorporated. |
@ianshmean sorry about that, this one has slipped through our fingers somehow once again. I'll try to re-review this tomorrow. Thanks for your patience @pldilley too! |
Hmm, so I've resolved the merge conflicts based on master. However I haven't tested it, and am perhaps a bit too busy in life now to have time. Can someone please just do a sanity check on it before merging? |
@petetnt Once you are done with the review, I will merge this PR 👍 I was trying to merge this an year back BTW, well almost! But this thread was not active, couldn't incorporate this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM codewise.
The new tests are failing now for some reason, not exactly sure why yet.
There's also a tiny bug where if you have the search bar open and toggle "Automatically close search" option the search bar only stays open after closing it once. However I don't think that's a blocker by any means.
👍
expect(getSearchField().val()).toEqual("Foo"); | ||
expectHighlightedMatches(capitalFooSelections); | ||
expectSelection(capitalFooSelections[0]); | ||
expectMatchIndex(0, 3); | ||
expect(myEditor.centerOnCursor.calls.length).toEqual(3); | ||
|
||
expect(myEditor).toHaveCursorPosition(8, 8, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This tests fails for me with expected the cursor to be at (8, 8) but it actually was at (2, 8) and more than one character was selected
, hmm.
twCommandManager.execute(Commands.CMD_FIND_NEXT); | ||
|
||
expect(myEditor).toHaveCursorPosition(8, 8, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar error with this one: expected the cursor to be at (8, 8) but it actually was at (2, 31) and more than one character was selected
, hmm.
Checking in on this. Seems to still be missing in 1.12. |
@ianshmean Totally agree with you. I hope to see this PR merged as well. @pldilley Can you please have a look at the review comments posted by @petetnt and incorporate the changes, if needed?. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, see #14141 for additional commit
Landed in #14141 with additional commit, thanks for your patience @pldilley, @ianshmean and @adrianhartanto0 |
P.S. Sorry I did not get to the test fixes. I hope this code change works out :) |
Reference:
Issue: #11261 - "keep the search bar open"
Based on this pull request that is waiting on the user: #11692 ( @adrianhartanto0 ). However I ended up taking a different approach; upon testing I found that the original approach had hiccups. The changes are influenced by the preference idea by @zaggino and @abose in the aforementioned pull request.
Changes:
Go to the next search item if the bar is open and the user clicks Find or hits ctrl+FTesting: