Closed rlisagor closed 7 years ago
I've been testing this PR with _examples/bufs.go
and looks like it introduces the following bug when v.Wrap = true
:
1.- Run go run _examples/bufs.go
and set the view as follows:
2.- Start writing at the end of the first line. After reaching the end of the line, the edition continues in the following line (just before B
) without adding a new line:
3.- If you do the same test with master
:
This is because edit.go should be rewritten taking into account the wrapping mode (that was introduced later) as well as other features like multi-width characters, etc.
More context: #69, #80, #90, #60
Fixed via 2677ad04454bb2a43069dda0675b602b0ec2c14c. Can you check? :)
Works for me, thanks for the fix!
The cause was that the line array was extended twice when writing at the end of a line - once in the first
if
clause because the cursor is beyond the end of the line, and then again in the secondif
clause dealing with theOverwrite
condition.This change makes the two
if
clauses mutually exclusive.Please let me know what you think or if you'd like me to make any changes.