Skip to content

Commit

Permalink
Merge pull request #73
Browse files Browse the repository at this point in the history
Fix line number order
  • Loading branch information
ruifm authored Feb 3, 2023
2 parents c68d487 + 8c20f0a commit cc59f73
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lua/gitlinker/buffer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ function M.get_range(mode, add_current_line_on_normal_mode)
local lstart
local lend
if mode == "v" then
lstart = vim.fn.getpos("v")[2]
lend = vim.fn.getcurpos()[2]
local pos1 = vim.fn.getpos("v")[2]
local pos2 = vim.fn.getcurpos()[2]
lstart = math.min(pos1, pos2)
lend = math.max(pos1, pos2)
elseif add_current_line_on_normal_mode == true then
lstart = M.get_curr_line()
end
Expand Down

0 comments on commit cc59f73

Please sign in to comment.