jeetsukumaran / vim-indentwise

A Vim plugin for indent-level based motion.
220 stars 17 forks source link

Movements are not relative to cursor position in visual mode #13

Open jan-warchol opened 7 years ago

jan-warchol commented 7 years ago

Nice plugin!

However, it doesn't work in the following scenario: I select some text in visual mode and would like to decrease the selection by one indented block. For example, I have the following text (with || marking current visual selection, and () marking cursor position):

[profiles]
  [[medium v0.8.2]]
    background_color = "#154053"
    foreground_color = "#a8bcc3"
    palette = "#1c4c62:#fc5851:#78b93e:#d8b033:#4e97f5:#f16dc5:#41c7b9:#718b97"

|  [[black v0.8]]
    background_color = "#1b1b1b"
    foreground_color = "#ababab"
    palette = "#2d2d2d:#e3413f:#67a82d:#c9a223:#3182de:#dd5ab2:#2cb8aa:#777777"
  [[black v0.8.3]]
    background_color = "#181818"
    foreground_color = "#b6b6b6"
    palette = "#252525:#eb4844:#70b136:#d4ad2f:#3a88e5:#e561ba:#3bc3b4:#757575"
  [[black v0.9]]
    background_color = "#181818"
    foreground_color = "#b9b9b9"
    (p)alette = "#252525:#ed4a46:#70b433:#dbb32d:#368aeb:#eb6eb7:#3fc5b7:#777777"|

I want to remove last block ("black v0.9") from selection. However, when I use [=, cursor jumps to 2nd line ("medium v0.8.2"). Without selection, it would jump up 4 lines (what I want).