···40end
4142local function get_value(node, bufnr)
43- if node ~= nil then
44- local value = node:field("value")[1]
45- return table.concat({ vim.treesitter.get_node_text(value, bufnr) }, "\n")
46- else
47 return ""
48 end
0049end
5051local function is_sequence_block(value)
···110 local human = string.format("%s = %s", key, cleaned_value)
111 local start_line, start_col = node:start()
112 local end_line = start_line
113- if value_node then
114 end_line, _ = value_node:end_()
115 end
116
···40end
4142local function get_value(node, bufnr)
43+ if node == nil then
00044 return ""
45 end
46+ local value = node:field("value")[1]
47+ return table.concat({ vim.treesitter.get_node_text(value, bufnr) }, "\n")
48end
4950local function is_sequence_block(value)
···109 local human = string.format("%s = %s", key, cleaned_value)
110 local start_line, start_col = node:start()
111 local end_line = start_line
112+ if value_node ~= nil then
113 end_line, _ = value_node:end_()
114 end
115
+2
tests/sample.yaml
···6 Here comes a two lines
7 text.
8009 semifinals:
10 - brazil: 1
11 germany: 7
···6 Here comes a two lines
7 text.
89+ morumbi:
10+11 semifinals:
12 - brazil: 1
13 germany: 7