Skip to content

Commit

Permalink
fix: replacing selection which includes last line
Browse files Browse the repository at this point in the history
closes #66
  • Loading branch information
gsuuon committed Nov 1, 2024
1 parent 1cce164 commit c979486
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/model/core/input.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ local function get_before_after(source)

local after = util.buf.text(after_range)

local after_last_line = after[#after]

return {
before = util.buf.text(before_range),
after = after,
Expand All @@ -68,7 +70,7 @@ local function get_before_after(source)
start = after_range.start,
stop = {
row = after_range.start.row + #after,
col = #after[#after],
col = after_last_line and #after_last_line or after_range.start,
},
},
}
Expand Down

0 comments on commit c979486

Please sign in to comment.