Skip to content

Commit

Permalink
fix(at-cursor): refs are also terminated by ]
Browse files Browse the repository at this point in the history
  • Loading branch information
jghauser committed Oct 13, 2024
1 parent 16983a7 commit bf1ee96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/papis/at-cursor/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ local function get_ref_under_cursor()
local line_until_cursor = current_line:sub(1, cursor_col)
local word_start_col = line_until_cursor:find("[^%s,;]*$") or 1
local line_after_cursor = current_line:sub(cursor_col)
local word_end_col = cursor_col + (line_after_cursor:find("[%s,;]") or #line_after_cursor) - 1
local word_end_col = cursor_col + (line_after_cursor:find("[%s,;%]]") or #line_after_cursor) - 1

-- Extract the word
local ref = current_line:sub(word_start_col, word_end_col)
Expand Down

0 comments on commit bf1ee96

Please sign in to comment.