Vim: g$ moves to next visual line

Created on 20 Sep 2017  路  2Comments  路  Source: VSCodeVim/Vim

  • Click thumbs-up 馃憤 on this issue if you want it!
  • Click confused 馃槙 on this issue if not having it makes VSCodeVim unusable.

The VSCodeVim team prioritizes issues based on reaction count.


This is a BUG REPORT:

Environment:

  • VSCode Version: 1.16.1
  • VsCodeVim Version: 0.10.1
  • OS: macOS 10.12.6

What happened:
Pressing g$ moved to the first character in the next visual line.

What did you expect to happen:
moved to the last character in the current visual line.

How to reproduce it:
Press g$ in the start of a soft-wrapped line.

kinbug

Most helpful comment

Same problem here. The cursor briefly flashes at the end of the line but then moves to the next visual line.

For now, this can be fixed by rebinding g$ to g$h

All 2 comments

Same problem here. The cursor briefly flashes at the end of the line but then moves to the next visual line.

For now, this can be fixed by rebinding g$ to g$h

I have also experienced this problem and have come up with a simple fix that works for me. In settings.json add the following settings

    "vim.normalModeKeyBindingsNonRecursive":[
        {"before": ["g","$"], "commands": [{"command": "cursorMove", "args": {"to": "wrappedLineEnd"}}]},
    ]

I tried to add the same mapping to vim.visualModeKeyBindingsNonRecursive too, but since it wasn't going through the correct vim code it didn't extend the selection, so it's only a partial workaround.

I had a quick look at the code to see what was causing the problem, and it seemed to be calling the right API function (the same one that I'm mapping to here) but must do some position manipulation afterwards that I don't understand well enough to try to fix.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rajinder-yadav picture rajinder-yadav  路  3Comments

gerardmrk picture gerardmrk  路  3Comments

WangRongda picture WangRongda  路  3Comments

spinningarrow picture spinningarrow  路  3Comments

AndersenJ picture AndersenJ  路  3Comments