Skip to content

Commit

Permalink
avoid attempt to add same line widget twice
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinushey committed Feb 18, 2020
1 parent 45d96c7 commit dcc58c2
Showing 1 changed file with 7 additions and 0 deletions.
Expand Up @@ -22,7 +22,14 @@ public class LineWidgetManager extends JavaScriptObject
protected LineWidgetManager() {}

public native final void addLineWidget(LineWidget widget) /*-{
// avoid duplicating a pre-existing line widget
var widgets = this.session.lineWidgets || {};
if (widgets[widget.row] === widget)
return;
this.addLineWidget(widget);
}-*/;

public native final void removeLineWidget(LineWidget widget) /*-{
Expand Down

0 comments on commit dcc58c2

Please sign in to comment.