summaryrefslogtreecommitdiffhomepage
path: root/src/blog/nvim-ts/get-parent.diff
diff options
context:
space:
mode:
Diffstat (limited to 'src/blog/nvim-ts/get-parent.diff')
-rw-r--r--src/blog/nvim-ts/get-parent.diff14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/blog/nvim-ts/get-parent.diff b/src/blog/nvim-ts/get-parent.diff
new file mode 100644
index 0000000..9599792
--- /dev/null
+++ b/src/blog/nvim-ts/get-parent.diff
@@ -0,0 +1,14 @@
+ if node == nil then
+ error('No Tree-Sitter parser found.')
+ end
++
++ while node ~= nil and node:type() ~= 'operation' do
++ node = node:parent()
++ end
++
++ if node ~= nil then
++ -- TODO
++ end
+ end, {
+ buffer = true,
+ noremap = true,