Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions app/src/processing/app/Base.java
Original file line number Diff line number Diff line change
Expand Up @@ -1877,6 +1877,15 @@ public void handleFontSizeChange(int change) {
PreferencesData.set("editor.font", StringUtils.join(pieces, ','));
getEditors().forEach(Editor::applyPreferences);
}

public void toggleLineNumber() {
if (PreferencesData.getBoolean("editor.linenumbers")) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be shortened to:
PreferencesData.setBoolean("editor.linenumbers", !PreferencesData.getBoolean("editor.linenumbers"));

PreferencesData.setBoolean("editor.linenumbers", false);
} else {
PreferencesData.setBoolean("editor.linenumbers", true);
}
getEditors().forEach(Editor::applyPreferences);
}

public List<JMenu> getBoardsCustomMenus() {
return boardsCustomMenus;
Expand Down
9 changes: 8 additions & 1 deletion app/src/processing/app/Editor.java
Original file line number Diff line number Diff line change
Expand Up @@ -1392,7 +1392,14 @@ public void actionPerformed(ActionEvent e) {
menu.add(decreaseFontSizeItem);

menu.addSeparator();


JMenuItem toggleLineNumber = newJMenuItemShift(tr("Toggle Line Numbers"), 'L');
toggleLineNumber.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
base.toggleLineNumber();
}
})

JMenuItem findItem = newJMenuItem(tr("Find..."), 'F');
findItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Expand Down