atom-vim-mode-plus icon indicating copy to clipboard operation
atom-vim-mode-plus copied to clipboard

[small bug] Pressing `%` while peyond last character of a line doesn't detect matching brace like in Vim/NeoVim.

Open trusktr opened this issue 7 years ago • 1 comments

There's one small issue that trips me up:

Suppose that we have the following code, and note the position of the white cursor (screenshot of Vim):

screen shot 2018-05-27 at 10 22 59 pm

Now suppose we press v to enter visual line mode, then we press $ to go to the end of the line so that we have the following selection:

screen shot 2018-05-27 at 10 24 09 pm

Note that the cursor is now after the { character of the first line.

I would now like to press % to go to the matching } character.

Expected:

In Vim, pressing % will detect the { character that is in front of the cursor and take us to the matching } character, which looks like this:

screen shot 2018-05-27 at 10 26 02 pm

Actual:

In Atom with vim-mode-plus, pressing % will not work, the cursor will stay in place. Starting with the cursor in the same place, here is a screenshot after pressing v$%:

screen shot 2018-05-27 at 10 27 12 pm

As you can tell, only the first line is highlighted because vim-mode-plus did not move to the matching } character.


It would be great to be anywhere on a line, and to be able to type V$% to highlight an entire block.

This works great in Vim/NeoVim, but doesn't work in vim-mode-plus at the moment.


debug info with package info
{
  "atom": "1.27.1",
  "platform": "darwin",
  "release": "17.5.0",
  "vmpVersion": "1.32.0",
  "vmpConfig": {
    "automaticallyEscapeInsertModeOnActivePaneItemChange": true,
    "keymapYToYankToLastCharacterOfLine": true,
    "wrapLeftRightMotion": true,
    "blackholeRegisteredOperators": [],
    "startInInsertModeScopes": [],
    "charactersToAddSpaceOnSurround": [],
    "highlightSearchExcludeScopes": [],
    "flashOnOperateBlacklist": []
  },
  "activeCommunityPackages": [
    "atom-material-syntax: 1.0.8",
    "atom-vim-like-tab: 1.5.1",
    "hey-pane: 1.1.0",
    "highlight-line: 0.12.0",
    "highlight-selected: 0.13.1",
    "keystroke: 0.4.0",
    "minimap: 4.29.8",
    "minimap-highlight-selected: 4.6.1",
    "minimap-quick-highlight: 1.0.1",
    "one-tab: 0.10.0",
    "quick-highlight: 0.13.0",
    "teletype: 0.13.2",
    "vim-mode-plus: 1.32.0",
    "vim-mode-plus-keymaps-for-surround: 0.2.1",
    "language-pug: 0.0.22",
    "platformio-ide-terminal: 2.8.1"
  ]
}

trusktr avatar May 28 '18 05:05 trusktr

As a workaround, I added this to my keymaps:

'.editor.vim-mode-plus.visual-mode':
    '$': 'keystroke $ h'

So that it moves one character back, then pressin % works. I also have this same setting in Vim, so it is nice. :)

trusktr avatar Jun 04 '18 20:06 trusktr