Skip to content

Commit 0932ebf

Browse files
authored
fix(editline): firstline has different column calculation (#132)
It should take a possible prefix into account.
1 parent 930a1d4 commit 0932ebf

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

spec/09-editline-format_spec.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,7 @@ describe("EditLine:", function()
980980
'some test data|'
981981
},
982982
1,
983-
15,
983+
55,
984984
}, {testwrap({
985985
width = 60,
986986
first_width = 20,

src/terminal/editline.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ do
612612
if l < first_width then
613613
-- cursor is on a first-line, on a regular position
614614
cur_line = 1
615-
cur_col = l + 1
615+
cur_col = l + 1 + (width - first_width)
616616
end
617617
else
618618
local l = lines[#lines]:len_col()

0 commit comments

Comments
 (0)