on master help sign in
Loop around the end on regex searches.
9ca2909Blaž Hrastnik
.gitmodules+3
@@ -82,3 +82,6 @@
82 path = helix-syntax/languages/tree-sitter-toml
82 path = helix-syntax/languages/tree-sitter-toml
83 url = https://github.com/ikatyang/tree-sitter-toml
83 url = https://github.com/ikatyang/tree-sitter-toml
84 shallow = true
84 shallow = true
85+[submodule "helix-syntax/nvim-treesitter"]
86+ path = helix-syntax/nvim-treesitter
87+ url = https://github.com/nvim-treesitter/nvim-treesitter
TODO.md+1−2
@@ -27,7 +27,6 @@
27
27
28- [ ] regex search / select next
28- [ ] regex search / select next
29- [ ] = for auto indent line/selection
29- [ ] = for auto indent line/selection
30−- [ ] yank on delete
31- [ ] :x for closing buffers
30- [ ] :x for closing buffers
32
31
33- [x] jumplist (push selections on goto / select on the view)
32- [x] jumplist (push selections on goto / select on the view)
@@ -59,7 +58,7 @@
59- [ ] macro recording
58- [ ] macro recording
60- [x] tab completion for paths on the prompt
59- [x] tab completion for paths on the prompt
61- [ ] extend selection (treesitter select parent node) (replaces viw, vi(, va( etc )
60- [ ] extend selection (treesitter select parent node) (replaces viw, vi(, va( etc )
62−- [ ] bracket pairs
61+- [x] bracket pairs
63- [x] comment block (gcc)
62- [x] comment block (gcc)
64- [ ] completion signature popups/docs
63- [ ] completion signature popups/docs
65- [ ] selection align
64- [ ] selection align
helix-syntax/nvim-treesitternew file+1

Submodule changed.

helix-term/src/commands.rs+5−2
@@ -612,8 +612,11 @@ fn _search(doc: &mut Document, view_id: ViewId, contents: &str, regex: &Regex) {
612 let text = doc.text();
612 let text = doc.text();
613 let start = doc.selection(view_id).cursor();
613 let start = doc.selection(view_id).cursor();
614
614
615− // TODO: use find_at to find the next match after the cursor, loop around the end
615+ // use find_at to find the next match after the cursor, loop around the end
616+ let mat = regex
617+ .find_at(contents, start)
618+ .or_else(|| regex.find(contents));
616− if let Some(mat) = regex.find_at(contents, start) {
619+ if let Some(mat) = mat {
617 let start = text.byte_to_char(mat.start());
620 let start = text.byte_to_char(mat.start());
618 let end = text.byte_to_char(mat.end());
621 let end = text.byte_to_char(mat.end());
619 let selection = Selection::single(start, end - 1);
622 let selection = Selection::single(start, end - 1);