Skip to content

Commit

Permalink
Preference to toggle "highlight selected word" on/off
Browse files Browse the repository at this point in the history
Defaulted to off because the feature doesn't work all that well IMHO
  • Loading branch information
jcheng5 committed Jun 10, 2011
1 parent 678cc72 commit 1f1be6a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
Expand Up @@ -33,7 +33,7 @@ public PrefValue<Boolean> showLineNumbers()

public PrefValue<Boolean> highlightSelectedWord()
{
return bool("highlight_selected_word", true);
return bool("highlight_selected_word", false);
}

public PrefValue<Boolean> highlightSelectedLine()
Expand Down
Expand Up @@ -37,6 +37,7 @@ public EditingPreferencesPane(SourceServerOperations server,
prefs_ = prefs;
res_ = res;

add(checkboxPref("Highlight selected word", prefs.highlightSelectedWord()));
add(checkboxPref("Highlight selected line", prefs.highlightSelectedLine()));
add(checkboxPref("Show line numbers", prefs.showLineNumbers()));
add(tight(spacesForTab_ = checkboxPref("Insert spaces for tab", prefs.useSpacesForTab())));
Expand Down
Expand Up @@ -670,6 +670,11 @@ public void setHighlightSelectedLine(boolean on)
widget_.getEditor().setHighlightActiveLine(on);
}

public void setHighlightSelectedWord(boolean on)
{
widget_.getEditor().setHighlightSelectedWord(on);
}

public void setShowLineNumbers(boolean on)
{
widget_.getEditor().getRenderer().setShowGutter(on);
Expand Down
Expand Up @@ -142,6 +142,7 @@ AnchoredSelection createAnchoredSelection(Position start,
void onVisibilityChanged(boolean visible);

void setHighlightSelectedLine(boolean on);
void setHighlightSelectedWord(boolean on);
void setShowLineNumbers(boolean on);
void setUseSoftTabs(boolean on);
void setUseWrapMode(boolean on);
Expand Down Expand Up @@ -638,6 +639,11 @@ private void registerPrefs()
public void execute(Boolean arg) {
docDisplay_.setHighlightSelectedLine(arg);
}}));
releaseOnDismiss_.add(prefs_.highlightSelectedWord().bind(
new CommandWithArg<Boolean>() {
public void execute(Boolean arg) {
docDisplay_.setHighlightSelectedWord(arg);
}}));
releaseOnDismiss_.add(prefs_.showLineNumbers().bind(
new CommandWithArg<Boolean>() {
public void execute(Boolean arg) {
Expand Down

0 comments on commit 1f1be6a

Please sign in to comment.