diff options
| author | Evgeni Chasnovski <evgeni.chasnovski@gmail.com> | 2026-05-17 18:34:06 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-05-17 11:34:06 -0400 |
| commit | db0682fe50d863328c7ff335486545fd71df02ae (patch) | |
| tree | da1646a9301824e131bc4ccbbab9a3a3535d1c68 /runtime/lua/nvim/spellfile.lua | |
| parent | 846b8b2420f074cc4c61ab57291b510b92ec0300 (diff) | |
| download | rneovim-db0682fe50d863328c7ff335486545fd71df02ae.tar.gz rneovim-db0682fe50d863328c7ff335486545fd71df02ae.tar.bz2 rneovim-db0682fe50d863328c7ff335486545fd71df02ae.zip | |
feat(ui): vim.ui.input(opts.scope) #39570
Problem: There is no way for a `vim.ui.input` caller to indicate for
which scope the input is. As in "This input is for something at cursor
scope". This information can be useful for `vim.ui.input`
implementation to tweak its behavior and presentation:
- Show different floating window depending on the scope. For example:
- Near cursor for "cursor" scope.
- At line start for "line" scope.
- In window corner for "buffer" and "window" scopes.
- In whole editor corner for "tabpage", "editor", "project" scopes.
- Navigate through history only for inputs with the same scope.
Solution: Document new `opts.scope` for `vim.ui.input`. Use it in the
codebase.
Diffstat (limited to 'runtime/lua/nvim/spellfile.lua')
| -rw-r--r-- | runtime/lua/nvim/spellfile.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/lua/nvim/spellfile.lua b/runtime/lua/nvim/spellfile.lua index f964d78a2f..5a33e7ee9e 100644 --- a/runtime/lua/nvim/spellfile.lua +++ b/runtime/lua/nvim/spellfile.lua @@ -281,7 +281,7 @@ function M.get(lang) info.lang, info.encoding ) - vim.ui.input({ prompt = prompt }, function(input) + vim.ui.input({ prompt = prompt, scope = 'editor' }, function(input) -- properly clear the message window vim.api.nvim_echo({ { ' ' } }, false, { kind = 'empty' }) if not input or input:lower() ~= 'y' then |