mirror of
https://github.com/hexedtech/codemp-intellij.git
synced 2024-12-22 20:44:53 +01:00
fix: remove cursor from users who move away from synced buffers
This commit is contained in:
parent
1e8306f6e4
commit
044b1f4470
3 changed files with 7 additions and 3 deletions
|
@ -23,7 +23,7 @@ public class BufferSyncAction extends AnAction {
|
|||
|
||||
String[] active_buffers = CodeMP.getActiveWorkspace().activeBuffers();
|
||||
int choice = Messages.showChooseDialog(
|
||||
"Detach from which buffer?",
|
||||
"Sync which buffer?",
|
||||
"CodeMP Buffer Detach",
|
||||
active_buffers,
|
||||
"",
|
||||
|
|
|
@ -70,4 +70,4 @@ public class CursorEventListener implements CaretListener {
|
|||
}
|
||||
})).start();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -49,7 +49,11 @@ public class CursorCallback implements Consumer<CursorController> {
|
|||
try {
|
||||
ApplicationManager.getApplication().runReadAction(() -> {
|
||||
Editor editor = FileUtil.getActiveEditorByPath(this.project, event.buffer);
|
||||
if(editor == null) return;
|
||||
if(editor == null) {
|
||||
RangeHighlighter previous = CodeMP.HIGHLIGHTER_MAP.remove(event.user);
|
||||
if(previous != null) previous.dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
int startOffset = editor.getDocument().getLineStartOffset(event.startRow) + event.startCol;
|
||||
int endOffset = editor.getDocument().getLineStartOffset(event.endRow) + event.endCol;
|
||||
|
|
Loading…
Reference in a new issue