File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 31
31
"Turn the node into a string, nils flow through. Separate forms are joined by
32
32
new lines."
33
33
(when node
34
- (vim.treesitter.query.get_node_text node (nvim.get_current_buf ))))
34
+ (if (= 1 (nvim.fn.has "nvim-0.7" ))
35
+ (vim.treesitter.query.get_node_text node (nvim.get_current_buf ))
36
+ (-> (vim.treesitter.query.get_node_text node )
37
+ (->> (str.join "\n " ))))))
35
38
36
39
(defn parent [node ]
37
40
"Get the parent if possible."
Original file line number Diff line number Diff line change 45
45
_2amodule_2a [" enabled?" ] = enabled_3f
46
46
local function node__3estr (node )
47
47
if node then
48
- return vim .treesitter .query .get_node_text (node , nvim .get_current_buf ())
48
+ if (1 == nvim .fn .has (" nvim-0.7" )) then
49
+ return vim .treesitter .query .get_node_text (node , nvim .get_current_buf ())
50
+ else
51
+ return str .join (" \n " , vim .treesitter .query .get_node_text (node ))
52
+ end
49
53
else
50
54
return nil
51
55
end
You can’t perform that action at this time.
0 commit comments