Skip to content

Commit

Permalink
Add checks to avoid incorrect creation of the visual position
Browse files Browse the repository at this point in the history
Related to VIM-3755
  • Loading branch information
AlexPl292 committed Dec 18, 2024
1 parent c225452 commit 69811c8
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/main/java/com/maddyhome/idea/vim/helper/IjEditorHelper.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,10 @@ import com.maddyhome.idea.vim.newapi.vim
@Service
internal class IjEditorHelper : EngineEditorHelperBase() {
override fun amountOfInlaysBeforeVisualPosition(editor: VimEditor, pos: VimVisualPosition): Int {
return (editor as IjVimEditor).editor.amountOfInlaysBeforeVisualPosition(
VisualPosition(
pos.line,
pos.column,
pos.leansRight,
),
)
require(pos.line >= 0)
require(pos.column >= 0)
val visualPosition = VisualPosition(pos.line, pos.column, pos.leansRight)
return (editor as IjVimEditor).editor.amountOfInlaysBeforeVisualPosition(visualPosition)
}

override fun getVisualLineAtTopOfScreen(editor: VimEditor): Int {
Expand Down

0 comments on commit 69811c8

Please sign in to comment.