We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c68d487 commit 8c20f0aCopy full SHA for 8c20f0a
lua/gitlinker/buffer.lua
@@ -15,8 +15,10 @@ function M.get_range(mode, add_current_line_on_normal_mode)
15
local lstart
16
local lend
17
if mode == "v" then
18
- lstart = vim.fn.getpos("v")[2]
19
- lend = vim.fn.getcurpos()[2]
+ local pos1 = vim.fn.getpos("v")[2]
+ local pos2 = vim.fn.getcurpos()[2]
20
+ lstart = math.min(pos1, pos2)
21
+ lend = math.max(pos1, pos2)
22
elseif add_current_line_on_normal_mode == true then
23
lstart = M.get_curr_line()
24
end
0 commit comments