Skip to content

Don't show completion while typing in range#46

Closed
artemave wants to merge 2 commits intohrsh7th:mainfrom
artemave:ignore-range-modifiers
Closed

Don't show completion while typing in range#46
artemave wants to merge 2 commits intohrsh7th:mainfrom
artemave:ignore-range-modifiers

Conversation

@artemave
Copy link
Copy Markdown

I use relative numbers to copy blocks of text. E.g. :-12,-10t. copies lines from 12 lines up to 10 lines to the line under cursor. The problem is that as soon as type in , I get this:

image

This pr addresses that problem.

Related to #45

E.g., at no point this should trigger completion:

    :-12,-10t.
Comment thread lua/cmp_cmdline/init.lua
-- -6,+7
-- +6,$
-- -6,-3t.
vim.regex(line_address_regex .. [=[,\?]=] .. line_address_regex .. [=[\s*[tmyd]\?\s*]=] .. line_address_regex),
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thank you for contribution!

Sirry. I can't understand the tmyd...

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Not entirely sure but these are shorthands for copy/t(:h co), move(m), yank, and delete that @artemave is trying to match in this regex since they are commonly used to manipulate lines in an Ex command.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Not entirely sure but these are shorthands for copy/t(:h co), move(m), yank, and delete that @artemave is trying to match in this regex since they are commonly used to manipulate lines in an Ex command.

Yes, that. Probably not an exhaustive list.

Copy link
Copy Markdown
Owner

@hrsh7th hrsh7th May 1, 2022

Choose a reason for hiding this comment

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

I think we can use \%[] pattern for it?

For example, 1, is a partial pattern but it should be matched.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

For example, 1, is a partial pattern but it should be matched.

It's matched, as far as I can see in manual tests.

@hrsh7th hrsh7th closed this in 79456dc Nov 13, 2022
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.

3 participants