feat: Allow multiple jumps in the same line (#9)

This commit is contained in:
danymat
2022-01-09 20:03:10 +01:00
parent 1f31319892
commit e3445e8f88

View File

@@ -94,9 +94,15 @@ neogen.generate = function(opts)
neogen.utilities.cursor.create(to_place + 1, start_column) neogen.utilities.cursor.create(to_place + 1, start_column)
-- Creates extmarks for the content -- Creates extmarks for the content
for i, value in pairs(content_with_marks) do for i, value in pairs(content_with_marks) do
local input_start, _ = string.find(value, jump_text) local start = 0
if input_start then local count = 0
neogen.utilities.cursor.create(to_place + i, input_start) while true do
start = string.find(value, jump_text, start + 1)
if not start then
break
end
neogen.utilities.cursor.create(to_place + i, start - count * #jump_text)
count = count + 1
end end
end end