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

Negative counts #3654

Open
blueyed opened this issue Dec 2, 2018 · 0 comments
Open

Negative counts #3654

blueyed opened this issue Dec 2, 2018 · 0 comments

Comments

@blueyed
Copy link

blueyed commented Dec 2, 2018

Negative counts for commands get handled according to -addr, and :lnext etc also appear to use "lines" there, which results in :-1 lnext not using the number of location list entries, but the lines in the current buffer, which is rather confusing.

  1. I think it would be good to have additional addr ranges for "items_loclist" and "items_quickfix", which would be used for related commands.
    I've found in the source that there is ADDR_QUICKFIX already, but this uses is_loclist_cmd (which checks if the command starts with "l" to determine if it should use the location or quickfix list), and therefore cannot be used with user commands.

  2. it would be good to have something like "-addr keep", which would not transform negative counts, so that :-1 Tc would echo count: -1, and not count: 41 (with 42 lines in the current buffer) (using :command! -bar -count=1 Tc echo 'count: '.<count>).
    I've found ADDR_OTHER in the source, which comes close, but a) cannot be given with -addr and b) does not keep negative counts, but uses MAXLNUM - count.

Current addr ranges from the help (some are not documented there, e.g. quickfix).

Possible values are:
     -addr=lines            Range of lines (this is the default)
     -addr=arguments        Range for arguments
     -addr=buffers          Range for buffers (also not loaded buffers)
     -addr=loaded_buffers   Range for loaded buffers
     -addr=windows          Range for windows
     -addr=tabs             Range for tab pages

I've given -addr=other a shot in #3653.

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

No branches or pull requests

1 participant