Skip to content

Commit

Permalink
New MultilineEdit.Model interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Pozhidaev committed Jul 30, 2018
1 parent d824f60 commit 5f0f592
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/main/java/org/luwrain/app/message/TextModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,16 @@ class TextModel extends MultilineEditModelTranslator
super(lines, hotPoint);
}

@Override public void insertChars(int pos , int lineIndex, String str)
@Override public boolean insertChars(int pos , int lineIndex, String str)
{
super.insertChars(pos, lineIndex, str);
if (!super.insertChars(pos, lineIndex, str))
return false;
processLine(lineIndex);
return true;
}

private void processLine(int index)
{

final String line = getLine(index);
if (line == null || line.length() <= maxLineLen)
return;
Expand All @@ -53,7 +54,8 @@ private void processLine(int index)
}
if (pos + 1 >= line.length())
return;
splitLines(pos, index);
if (splitLine(pos, index) == null)
return;
while(true)
{
final String newLine = getLine(index + 1);
Expand Down

0 comments on commit 5f0f592

Please sign in to comment.