Merge pull request #61 from Freakazo/master

Check that line is not empty.
This commit is contained in:
Vadim Lopatin 2015-02-17 09:32:22 +03:00
commit 36a95e6849
1 changed files with 1 additions and 1 deletions

View File

@ -605,7 +605,7 @@ class EditableContent {
return res;
dstring s = line(pos.line);
int p = pos.pos;
if (p < 0 || p > s.length)
if (p < 0 || p > s.length || s.length == 0)
return res;
dchar leftChar = p > 0 ? s[p - 1] : 0;
dchar rightChar = p < s.length - 1 ? s[p + 1] : 0;