Skip to content

Commit

Permalink
Eliminate command briefly shifting left in console input area after h…
Browse files Browse the repository at this point in the history
…itting Enter
  • Loading branch information
jcheng5 committed Jun 1, 2011
1 parent 5e07d44 commit a6c973b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
Expand Up @@ -539,6 +539,9 @@ public String processCommandEntry()
String promptText = prompt_.getElement().getInnerText();
String commandText = input_.getCode();
input_.setInputText("");
// Force render to avoid subtle command movement in the console, caused
// by the prompt disappearing before the input line does
input_.forceImmediateRender();
prompt_.setHTML("");

SpanElement pendingPrompt = Document.get().createSpanElement();
Expand Down
Expand Up @@ -730,6 +730,11 @@ public void scrollToCursor(ScrollPanel scrollPanel, int padding)
padding);
}

public void forceImmediateRender()
{
widget_.getEditor().getRenderer().forceImmediateRender();
}

private final HandlerManager handlers_ = new HandlerManager(this);
private final AceEditorWidget widget_;
private CompletionManager completionManager_;
Expand Down
Expand Up @@ -96,4 +96,8 @@ public native final void scrollToY(int scrollTop) /*-{
public native final void scrollToX(int scrollLeft) /*-{
this.scrollToX(scrollLeft);
}-*/;

public native final void forceImmediateRender() /*-{
this.$renderChanges(this.CHANGE_FULL);
}-*/;
}

0 comments on commit a6c973b

Please sign in to comment.