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

Actions on text objects are not performed if the cursor is positioned before the text object #686

Open
rwmpelstilzchen opened this issue Feb 26, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@rwmpelstilzchen
Copy link
Contributor

rwmpelstilzchen commented Feb 26, 2024

Describe the bug

Following this I did some testing, and found that if the cursor is positioned in the text object, actions are performed as expected, but if it is positioned before the text object, they are ignored. The default (Neo)Vim behaviour is that if a text-object action is called when the cursor is not within a text object of that type, it is performed on the next text object of the same type in the same line, if there is one.

Steps to reproduce

Consider this line:

hello "world" ~blabla~

If the cursor is at the beginning of the line and di" is called, the word world will be deleted. Now, if di~ is called, nothing happens (unless the cursor is within ~blabla~, of course).

Expected behavior

The expected behaviour would be for ~blabla~ to be deleted.

Emacs functionality

No response

Minimal init.lua

-- Enter your minimal_init.lua here

Screenshots and recordings

No response

OS / Distro

Arch Linux

Neovim version/commit

0.9.4

Additional context

No response

@rwmpelstilzchen rwmpelstilzchen added the bug Something isn't working label Feb 26, 2024
@PriceHiller
Copy link
Contributor

I'll take a look at this by this weekend and see about resolving it if nobody else does as a heads up.

@rwmpelstilzchen
Copy link
Contributor Author

Thx ^_^

PriceHiller added a commit to PriceHiller/orgmode that referenced this issue Mar 4, 2024
Resolves: nvim-orgmode#686

NOTE: This is very much in a TODO state, clean up and refactoring
required. This is just a MVP — not good enough for a PR yet 🙁.
PriceHiller added a commit to PriceHiller/orgmode that referenced this issue Mar 4, 2024
Resolves: nvim-orgmode#686

NOTE: Cleanup to be done, and this needs to be shifted into the larger
`textobjects` module instead of the current utils/textobjects one.

NOTE: This now is 100% identical to how word motions work on quotes for
all emphasis markers.
PriceHiller added a commit to PriceHiller/orgmode that referenced this issue Mar 5, 2024
PriceHiller added a commit to PriceHiller/orgmode that referenced this issue Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants