Skip to content

Commit

Permalink
Fix orion document changing event getting text from native orion even…
Browse files Browse the repository at this point in the history
…t instead of guessing it

Signed-off-by: Sun Tan <sutan@redhat.com>
  • Loading branch information
sunix committed Feb 15, 2018
1 parent 59f813d commit 523b823
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private void fireDocumentChangeEvent(final ModelChangedEventOverlay param) {
int addedCharCount = param.addedCharCount();
int removedCharCount = param.removedCharCount();

String text = editorOverlay.getModel().getText(startOffset, startOffset + addedCharCount);
String text = param.getText();

final DocumentChangedEvent event =
new DocumentChangedEvent(this, startOffset, addedCharCount, text, removedCharCount);
Expand All @@ -104,7 +104,7 @@ private void fireDocumentChangingEvent(final ModelChangedEventOverlay param) {
int addedCharCount = param.addedCharCount();
int removedCharCount = param.removedCharCount();

String text = editorOverlay.getModel().getText(startOffset, startOffset + addedCharCount);
String text = param.getText();

final DocumentChangingEvent event =
new DocumentChangingEvent(this, startOffset, addedCharCount, text, removedCharCount);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,8 @@ public final native int removedLineCount() /*-{
public final native int start() /*-{
return this.start;
}-*/;

public final native String getText() /*-{
return this.text;
}-*/;
}

0 comments on commit 523b823

Please sign in to comment.