Skip to content

Commit

Permalink
Use the read action to get the caret offset in EditorSelectionHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexPl292 committed Feb 26, 2025
1 parent a5ac2e9 commit 0b7c86f
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -590,9 +590,9 @@ internal object VimListenerManager {
// and dragging left or vertically upwards, the last character prior to EOL
// remains unselected. It's not clear why this happens, but this code fixes it.
val caret = editor.caretModel.currentCaret
val caretOffset = caret.offset
val lineStart = ijVimEditor.getLineStartForOffset(caret.offset)
val lineEnd = ijVimEditor.getLineEndForOffset(caret.offset)
val caretOffset = ApplicationManager.getApplication().runReadAction<Int> { caret.offset }
val lineStart = ijVimEditor.getLineStartForOffset(caretOffset)
val lineEnd = ijVimEditor.getLineEndForOffset(caretOffset)
val startOffset = selectionEvent.newRange.startOffset
val endOffset = selectionEvent.newRange.endOffset

Expand Down

0 comments on commit 0b7c86f

Please sign in to comment.