Browse files

fix backspace at end of file

  • Loading branch information...
1 parent f6e5149 commit 5cb57440aada7befb19e8f4e24c1f6060b409e61 @NotFound committed Dec 15, 2011
Showing with 10 additions and 6 deletions.
  1. +10 −6 examples/pokedit.winxed
View
16 examples/pokedit.winxed
@@ -538,14 +538,18 @@ class TextWindow : ChildWindow
self.drawline(curline);
}
else if (curline > 0) {
- string line = text[curline];
- delete text[curline];
+ if (curline < elements(text)) {
+ string line = text[curline];
+ delete text[curline];
+ string prevline = text[curline - 1];
+ curpos = length(prevline);
+ line = prevline + line;
+ text[curline - 1] = line;
+ }
+ else
+ curpos = length(text[curline - 1]);
--curline;
self.curline =: curline;
- string prevline = text[curline];
- curpos = length(prevline);
- line = prevline + line;
- text[curline] = line;
self.curpos =: curpos;
drawall = true;
}

0 comments on commit 5cb5744

Please sign in to comment.