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

API: nvim_get_mode(): return command-line type #16891

Open
zeertzjq opened this issue Jan 2, 2022 · 5 comments
Open

API: nvim_get_mode(): return command-line type #16891

zeertzjq opened this issue Jan 2, 2022 · 5 comments
Labels
api libnvim, Nvim RPC API enhancement feature request needs:discussion For PRs that propose significant changes to some part of the architecture or API

Comments

@zeertzjq
Copy link
Member

zeertzjq commented Jan 2, 2022

Feature already in Vim?

N/A (Nvim API)

Feature description

Sometimes nvim_get_mode() doesn't return enough information to indicate the current mode, especially when in command-line mode (ref vim/vim#6127, #11846), where mode returned by nvim_get_mode() sometimes doesn't start with c. A solution to this I can think of is to also return command-line type (getcmdtype()) from nvim_get_mode(). This will enable one to correctly tell whether the current mode is command-line mode from a fast API. However, introducing a new key to nvim_get_mode() will require modifying a lot of functional tests.

@zeertzjq zeertzjq added enhancement feature request api libnvim, Nvim RPC API needs:discussion For PRs that propose significant changes to some part of the architecture or API labels Jan 2, 2022
@zeertzjq
Copy link
Member Author

zeertzjq commented Jan 2, 2022

Actually this can be an optional key that is present only when the current mode is command-line mode, which doesn't require modifying a lot of functional tests.

@craigmac

This comment has been minimized.

@craigmac

This comment has been minimized.

@gpanders

This comment has been minimized.

@justinmk
Copy link
Member

justinmk commented Apr 23, 2022

Related: #18194

Actually this can be an optional key that is present only when the current mode is command-line mode, which doesn't require modifying a lot of functional tests.

The interface is most important. Modifying tests is a one-time cost. The interface is forever.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api libnvim, Nvim RPC API enhancement feature request needs:discussion For PRs that propose significant changes to some part of the architecture or API
Projects
None yet
Development

No branches or pull requests

4 participants