Skip to content

Commit

Permalink
close popup on editor event (#1834)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinushey committed Dec 11, 2017
1 parent 87a2560 commit c970996
Showing 1 changed file with 15 additions and 0 deletions.
Expand Up @@ -74,6 +74,7 @@
import org.rstudio.studio.client.workbench.views.source.editors.text.NavigableSourceEditor;
import org.rstudio.studio.client.workbench.views.source.editors.text.RCompletionContext;
import org.rstudio.studio.client.workbench.views.source.editors.text.ScopeFunction;
import org.rstudio.studio.client.workbench.views.source.editors.text.ace.AceEditorCommandEvent;
import org.rstudio.studio.client.workbench.views.source.editors.text.ace.CodeModel;
import org.rstudio.studio.client.workbench.views.source.editors.text.ace.DplyrJoinContext;
import org.rstudio.studio.client.workbench.views.source.editors.text.ace.Position;
Expand Down Expand Up @@ -247,6 +248,20 @@ public void onAttachOrDetach(AttachEvent event)
}
}));

// hide the autocompletion popup if the user executes
// an Ace editor command (e.g. insert pipe operator)
handlers_.add(eventBus_.addHandler(
AceEditorCommandEvent.TYPE,
new AceEditorCommandEvent.Handler()
{
@Override
public void onEditorCommand(AceEditorCommandEvent event)
{
invalidatePendingRequests();
close();
}
}));

}

@Inject
Expand Down

0 comments on commit c970996

Please sign in to comment.