Skip to content

Commit 7f58936

Browse files
fix(utils): remove visual selection and visual block mode helpers
fix(utils): remove unused variables fix(utils): remove start_col and end_col
1 parent 900e08e commit 7f58936

1 file changed

Lines changed: 1 addition & 13 deletions

File tree

lua/jumpy/utils.lua

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,10 @@ function M.get_visual_selection(bufnr)
99
local end_pos = vim.fn.getpos(".")
1010

1111
local start_line = start_pos[2]
12-
local start_col = start_pos[3]
1312
local end_line = end_pos[2]
14-
local end_col = end_pos[3]
1513

16-
if start_line > end_line or (start_line == end_line and start_col > end_col) then
14+
if start_line > end_line or (start_line == end_line) then
1715
start_line, end_line = end_line, start_line
18-
start_col, end_col = end_col, start_col
1916
end
2017

2118
local lines = vim.api.nvim_buf_get_lines(bufnr, start_line - 1, end_line, false)
@@ -24,15 +21,6 @@ function M.get_visual_selection(bufnr)
2421
return nil
2522
end
2623

27-
if mode == "v" then
28-
lines[1] = lines[1]:sub(start_col)
29-
lines[#lines] = lines[#lines]:sub(1, end_col)
30-
elseif mode == "\22" then
31-
for i, line in ipairs(lines) do
32-
lines[i] = line:sub(start_col, end_col)
33-
end
34-
end
35-
3624
return {
3725
text = table.concat(lines, "\n"),
3826
start_line = start_line,

0 commit comments

Comments
 (0)