mirror of
https://github.com/arduino/Arduino.git
synced 2024-11-29 10:24:12 +01:00
parent
19c3def582
commit
452ac63200
@ -80,6 +80,8 @@ import javax.swing.TransferHandler;
|
||||
import javax.swing.event.MenuEvent;
|
||||
import javax.swing.event.MenuListener;
|
||||
import javax.swing.text.BadLocationException;
|
||||
import javax.swing.text.Document;
|
||||
import javax.swing.text.Element;
|
||||
|
||||
import org.fife.ui.rsyntaxtextarea.folding.FoldManager;
|
||||
|
||||
|
@ -30,7 +30,8 @@ import java.awt.BorderLayout;
|
||||
import java.awt.Font;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
|
||||
import java.awt.event.FocusEvent;
|
||||
import java.awt.event.FocusListener;
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.swing.Action;
|
||||
@ -175,6 +176,15 @@ public class EditorTab extends JPanel implements SketchFile.TextStorage {
|
||||
|
||||
editor.lineStatus.set(lineStart, lineEnd);
|
||||
});
|
||||
textArea.addFocusListener(new FocusListener() {
|
||||
public void focusGained(FocusEvent e) {
|
||||
Element root = textArea.getDocument().getDefaultRootElement();
|
||||
int lineStart = root.getElementIndex(textArea.getCaret().getMark());
|
||||
int lineEnd = root.getElementIndex(textArea.getCaret().getDot());
|
||||
editor.lineStatus.set(lineStart, lineEnd);
|
||||
};
|
||||
public void focusLost(FocusEvent e) {};
|
||||
});
|
||||
ToolTipManager.sharedInstance().registerComponent(textArea);
|
||||
|
||||
configurePopupMenu(textArea);
|
||||
|
Loading…
Reference in New Issue
Block a user