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

"omap f <Plug>Sneak_f" does not include last char in buffer (using "co") #228

Open
blueyed opened this issue Aug 10, 2018 · 4 comments
Open
Labels

Comments

@blueyed
Copy link
Contributor

blueyed commented Aug 10, 2018

Given a minimal vimrc:

let &runtimepath .= ','.fnamemodify(expand('<sfile>'), ':h')
omap f <Plug>Sneak_f

cfl in a buffer that contains only one like "eval" will result in l being left (and not changed/removed).
This appears to be related for when it is at the end of the buffer, i.e. a newline after it will remove the "l" as expected.

@justinmk justinmk added the bug label Aug 10, 2018
@justinmk
Copy link
Owner

I wonder if #181 fixes this.

@blueyed
Copy link
Contributor Author

blueyed commented Aug 10, 2018

Nope..

@ggandor
Copy link
Contributor

ggandor commented May 27, 2021

Yep, operators won't work properly if the target area extends to the very last column in the buffer, because we cannot "nudge" the cursor beyond the last column (to compensate the default "exclusive" interpretation of the motion). There are two solutions: 1. We can just tell the user to use the 'v' modifier, forcing inclusiveness (:h o_v) 2. We could set virtualedit temporarily to onemore, move the cursor beyond the last column, and then revert virtualedit with an autocommand after the function has finished. Do we need to bother with this edge case?

@justinmk
Copy link
Owner

justinmk commented Jul 7, 2021

We could set virtualedit temporarily to onemore, move the cursor beyond the last column, and then revert virtualedit with an autocommand after the function has finished.

good idea! not ideal because it changes the :verbose set virtualedit? history, but we could be smart about it and only do this hack when this edge case is detected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants