Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VIM issue - v + e #4354

Closed
1 task done
decomoraes opened this issue Nov 13, 2023 · 8 comments · Fixed by #7424
Closed
1 task done

VIM issue - v + e #4354

decomoraes opened this issue Nov 13, 2023 · 8 comments · Fixed by #7424
Labels
defect [core label] vim

Comments

@decomoraes
Copy link

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

Hello, I notice that I'm having an issue with the vim mode, for example, I have this code:

string(character)

I put the cursor in the first letter of character, I press v + e, to select the word, but it selects also the ) character.

Environment

zsh: command not found: copy

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

If you only need the most recent lines, you can run the zed: open log command palette action to see the last 1000.

No response

@decomoraes decomoraes added admin read Pending admin review defect [core label] triage Maintainer needs to classify the issue labels Nov 13, 2023
@JosephTLyons JosephTLyons added vim and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Nov 14, 2023
@andmarek
Copy link
Contributor

I just noticed this as well. A couple things to note:

  • It's seems to be the 'e' motion, not just the v + e. So 'e' in regular mode starting at the beginning parenthesis or first character at the beginning parenthesis goes to the closing parenthesis.

  • This does not seem to be the case for every language for me. I was not able to repro this in JavaScript but I was able to in Python.

  • If you press "b" (the opposite motion) it seems to function correctly

@JosephTLyons JosephTLyons transferred this issue from zed-industries/community Jan 24, 2024
@mrnugget
Copy link
Member

Is this still an issue? When I try string(character) with cursor on s and hit v e I get <string>(character), with <> being the selection. Seems to be the same thing as in Vim.

@andmarek
Copy link
Contributor

Is this still an issue? When I try string(character) with cursor on s and hit v e I get <string>(character), with <> being the selection. Seems to be the same thing as in Vim.

Seems fine for me now as me as well.

@mrnugget
Copy link
Member

Alright, closing for now! We can always reopen :)

@decomoraes
Copy link
Author

decomoraes commented Jan 30, 2024

Hello, it's not resolved,

For example

const letter = "a"

something(letter)

Place your cursor on the l and then press v e. You'll notice that the ) is also selected.

@andmarek
Copy link
Contributor

Hello, it's not resolved,

For example

const letter = "a"

something(letter)

Put your cursor on l, then hit v e

Ah I see. I suppose I attempted to re-produce your issue incorrectly the first time. I initially added a semi-colon, which does indeed work correctly:

Screenshot 2024-01-30 at 9 51 49 AM

But when I omit the semi-colon after the function invocation:
Screenshot 2024-01-30 at 9 52 09 AM

The issue that you were facing still occurs.

@decomoraes
Copy link
Author

Well observed, thank you for your attention. I'm really looking forward to contributing to Zed through programming.

@decomoraes
Copy link
Author

Hello @mrnugget, can you reopen this issue?

@mrnugget mrnugget reopened this Jan 30, 2024
ConradIrwin pushed a commit that referenced this issue Feb 7, 2024
This was originally just to fix
#4354, which I did by just
returning the previous offset in `find_boundary`.. but `find_boundary`
is used in the "insert mode" / normal editor too, so returning the
previous boundary breaks existing functionality in that case.

I was considering a new `find_boundary` function just for some of the
vim motions like this, but I thought that this is straightforward enough
and future Vim functions might need similar logic too.

Release Notes:

- Fixed #4354
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect [core label] vim
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants