aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitmodules3
-rw-r--r--TODO.md3
m---------helix-syntax/nvim-treesitter0
-rw-r--r--helix-term/src/commands.rs7
4 files changed, 9 insertions, 4 deletions
diff --git a/.gitmodules b/.gitmodules
index f4d6456c..3cfb7b56 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -82,3 +82,6 @@
path = helix-syntax/languages/tree-sitter-toml
url = https://github.com/ikatyang/tree-sitter-toml
shallow = true
+[submodule "helix-syntax/nvim-treesitter"]
+ path = helix-syntax/nvim-treesitter
+ url = https://github.com/nvim-treesitter/nvim-treesitter
diff --git a/TODO.md b/TODO.md
index 9561660e..00855ac9 100644
--- a/TODO.md
+++ b/TODO.md
@@ -27,7 +27,6 @@
- [ ] regex search / select next
- [ ] = for auto indent line/selection
-- [ ] yank on delete
- [ ] :x for closing buffers
- [x] jumplist (push selections on goto / select on the view)
@@ -59,7 +58,7 @@
- [ ] macro recording
- [x] tab completion for paths on the prompt
- [ ] extend selection (treesitter select parent node) (replaces viw, vi(, va( etc )
-- [ ] bracket pairs
+- [x] bracket pairs
- [x] comment block (gcc)
- [ ] completion signature popups/docs
- [ ] selection align
diff --git a/helix-syntax/nvim-treesitter b/helix-syntax/nvim-treesitter
new file mode 160000
+Subproject 1f00ecdfa36ef5e43a4feaf189e8c2c003118c0
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 2e205fa6..0cbc3f9d 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -612,8 +612,11 @@ fn _search(doc: &mut Document, view_id: ViewId, contents: &str, regex: &Regex) {
let text = doc.text();
let start = doc.selection(view_id).cursor();
- // TODO: use find_at to find the next match after the cursor, loop around the end
- if let Some(mat) = regex.find_at(contents, start) {
+ // use find_at to find the next match after the cursor, loop around the end
+ let mat = regex
+ .find_at(contents, start)
+ .or_else(|| regex.find(contents));
+ if let Some(mat) = mat {
let start = text.byte_to_char(mat.start());
let end = text.byte_to_char(mat.end());
let selection = Selection::single(start, end - 1);