@Override public void run() { try { CsmReference ref = CsmReferenceResolver.getDefault().findReference(doc, event.getCaretOffset()); if (ref == null) { return;
private void process(Collection<CodeAudit> audits, final Document doc, final FileObject fileObject, CursorMovedSchedulerEvent cursorEvent, final CsmFile file, final AtomicBoolean canceled) { clearHint(doc, fileObject); int caretOffset = cursorEvent.getCaretOffset(); JTextComponent comp = EditorRegistry.lastFocusedComponent(); int selectionStart = caretOffset; int selectionEnd = caretOffset; if (comp != null) { selectionStart = Math.min(cursorEvent.getCaretOffset(),cursorEvent.getMarkOffset());//comp.getSelectionStart(); selectionEnd = Math.max(cursorEvent.getCaretOffset(),cursorEvent.getMarkOffset());//comp.getSelectionEnd();
private void runImpl(final CursorMovedSchedulerEvent event, final CsmFile csmFile, final Document doc, final AtomicBoolean canceled) { if (doc == null) { return; } Object obj = doc.getProperty(CsmMacroExpansion.USE_OWN_CARET_POSITION); if (obj != null) { if(!(Boolean) obj) { return; } } Runnable syncPositions = new Runnable() { @Override public void run() { if (!canceled.get()) { syncRelatedDocumentCaretPosition(event, doc); } } }; if (isMacroExpansionDoc(doc)) { SwingUtilities.invokeLater(syncPositions); } else { MacroExpansionViewUtils.updateView(doc, event.getCaretOffset(), csmFile, canceled, syncPositions); } }
if (file2 != null && comp2 != null) { int doc2CarretPosition = comp2.getCaretPosition(); int docCarretPosition = event.getCaretOffset(); int doc2CarretPositionFromDoc = MacroExpansionViewUtils.getDocumentOffset(doc2, MacroExpansionViewUtils.getFileOffset(doc, docCarretPosition));