Skip to content

Conversation

@ricardonunez-io
Copy link

@ricardonunez-io ricardonunez-io commented Feb 11, 2025

  • m m bracket matching uses cursor position instead of selection start
  • Line boundaries excluded from word motion boundaries
  • Support for h and l motions in visual mode
  • x motion overflowing to new line
  • w and b motions now correctly handle inclusive cursor behavior
  • Cursor positioned at start of selection on insert across back and forward motions

Copy link
Owner

@jasonwilliams jasonwilliams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some nice changes here, I have a couple of questions

Comment on lines 183 to 192
parseKeysExact(['x'], [Mode.Normal, Mode.Visual], (vimState, editor) => {
editor.selections = editor.selections.map((selection) => {
const line = editor.document.lineAt(selection.active.line);
return new vscode.Selection(
new vscode.Position(selection.active.line, 0),
new vscode.Position(selection.active.line, line.text.length),
);
});
enterVisualLineMode(vimState);
setModeCursorStyle(vimState.mode, editor);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this has broken hitting x multiple times extending to the next line each time. It now only selects the current line and stops

[KeyMap.Actions.InsertMode],
[Mode.Normal, Mode.Visual, Mode.VisualLine, Mode.Occurrence],
(vimState, editor) => {
// In visual mode, move cursor to start of selection before entering insert mode
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im confused with this, didn't it already work? Im testing on main and visual mode to insert mode puts me at the beggining of the selection. Do you have some before and after steps for me to try?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On main for me, if I go to any line in the middle of a bunch of words, hit b, and then hit i, the cursor goes to the end of the selection from where I initially hit b.

@ricardonunez-io
Copy link
Author

Hi @jasonwilliams! Thanks for the review, didn't even realize you had responded so early after the PR, will address these tonight

@jasonwilliams
Copy link
Owner

Hey @ricardonunez-io just some conflicts, i assume this is ready for me to have a look at again?

@ricardonunez-io
Copy link
Author

Hey @jasonwilliams! So sorry, got caught up with work, and missed this notification. Unfortunately not yet ready for review, ended up running into some more bugs that popped up when I tried fixing multiple-line 'X' selections. I'll let you know once it's ready and clean up any conflicts, thank you!

@jasonwilliams
Copy link
Owner

Hey @ricardonunez-io how has this been going?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants