1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2025-05-08 06:34:08 +02:00

Add information when the characterwise motion changes to the linewise

This commit is contained in:
Alex Plate 2025-03-07 10:03:59 +02:00
parent 4a31e425e0
commit 9ba0f5f47a
No known key found for this signature in database
GPG Key ID: 0B97153C8FFEC09F

View File

@ -106,6 +106,10 @@ open class YankGroupBase : VimYankGroup {
assert(motionRange.size() == 1)
startOffsets?.put(caret, motionRange.normalize().startOffset)
// Yank motion commands that are not linewise become linewise if all the following are true:
// 1) The range is across multiple lines
// 2) There is only whitespace before the start of the range
// 3) There is only whitespace after the end of the range
if (argument.motion is MotionActionHandler && argument.motion.motionType == MotionType.EXCLUSIVE) {
val start = editor.offsetToBufferPosition(motionRange.startOffset)
val end = editor.offsetToBufferPosition(motionRange.endOffset)