Skip to content

Commit

Permalink
Refactor treesitter.fnl to remove aniseed nvim module
Browse files Browse the repository at this point in the history
  • Loading branch information
saccarosium committed Jan 15, 2025
1 parent 1b4b1f6 commit db81a84
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
11 changes: 5 additions & 6 deletions fnl/conjure/tree-sitter.fnl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
(local {: autoload} (require :nfnl.module))
(local a (autoload :nfnl.core))
(local nvim (autoload :conjure.aniseed.nvim))
(local client (autoload :conjure.client))
(local config (autoload :conjure.config))
(local text (autoload :conjure.text))
Expand Down Expand Up @@ -37,8 +36,8 @@
new lines."
(when node
(if vim.treesitter.get_node_text
(vim.treesitter.get_node_text node (nvim.get_current_buf))
(vim.treesitter.query.get_node_text node (nvim.get_current_buf)))))
(vim.treesitter.get_node_text node (vim.api.nvim_get_current_buf))
(vim.treesitter.query.get_node_text node (vim.api.nvim_get_current_buf)))))

(fn lisp-comment-node? [node]
"Node is a (comment ...) form"
Expand Down Expand Up @@ -119,16 +118,16 @@
(config.get-in [:extract :form_pairs]))
(a.some
(fn [[start end]]
(and (text.starts-with node-str start)
(text.ends-with node-str end)))
(and (vim.startswith node-str start)
(vim.endswith node-str end)))
extra-pairs)
false)))

(fn node-prefixed-by-chars? [node prefixes]
(let [node-str (node->str node)]
(or (a.some
(fn [prefix]
(text.starts-with node-str prefix))
(vim.startswith node-str prefix))
prefixes)
false)))

Expand Down
9 changes: 4 additions & 5 deletions lua/conjure/tree-sitter.lua

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit db81a84

Please sign in to comment.