Skip to content

Commit

Permalink
view: keeps ved from crashing if x is hit on blank line (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
JalonSolov authored Sep 8, 2020
1 parent d3c4058 commit 25e570d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ved.exe
2 changes: 1 addition & 1 deletion view.v
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ fn (mut view View) shift_left() {

fn (mut v View) delete_char() {
u := v.uline()
if v.x >= u.len {
if u.len < 1 || v.x >= u.len {
return
}
left := u.left(v.x)
Expand Down

0 comments on commit 25e570d

Please sign in to comment.