diff options
author | matveyt <35012635+matveyt@users.noreply.github.com> | 2022-07-17 14:14:04 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-17 04:14:04 -0700 |
commit | eb9b93b5e025386ec9431c9d35a4a073d6946d1d (patch) | |
tree | 4b371f7cf93aab052770590b9b995f94c8662fbd /src | |
parent | aae11865e1f74678a6415703ce1e076d195a2c26 (diff) | |
download | rneovim-eb9b93b5e025386ec9431c9d35a4a073d6946d1d.tar.gz rneovim-eb9b93b5e025386ec9431c9d35a4a073d6946d1d.tar.bz2 rneovim-eb9b93b5e025386ec9431c9d35a4a073d6946d1d.zip |
feat(defaults): mouse=nvi #19290
Problem:
Since right-click can now show a popup menu, we can provide messaging to
guide users who expect 'mouse' to be disabled by default. So 'mouse' can
now be enabled by default.
Solution:
Do it.
Closes #15521
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/main.c | 9 | ||||
-rw-r--r-- | src/nvim/mapping.c | 18 | ||||
-rw-r--r-- | src/nvim/options.lua | 4 |
3 files changed, 10 insertions, 21 deletions
diff --git a/src/nvim/main.c b/src/nvim/main.c index db588d4694..b06b9630e2 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -356,7 +356,14 @@ int main(int argc, char **argv) abort(); // unreachable } - init_default_mappings(); // Default mappings. + // Default mappings (incl. menus) + Error err = ERROR_INIT; + Object o = nlua_exec(STATIC_CSTR_AS_STRING("return vim._init_default_mappings()"), + (Array)ARRAY_DICT_INIT, &err); + assert(!ERROR_SET(&err)); + api_clear_error(&err); + assert(o.type == kObjectTypeNil); + api_free_object(o); TIME_MSG("init default mappings"); init_default_autocmds(); diff --git a/src/nvim/mapping.c b/src/nvim/mapping.c index 7f4df66b4d..5a11ac686e 100644 --- a/src/nvim/mapping.c +++ b/src/nvim/mapping.c @@ -2113,24 +2113,6 @@ void f_mapcheck(typval_T *argvars, typval_T *rettv, FunPtr fptr) get_maparg(argvars, rettv, false); } -void init_default_mappings(void) -{ - add_map("Y", "y$", MODE_NORMAL, false); - - // Use normal! <C-L> to prevent inserting raw <C-L> when using i_<C-O> - // See https://github.com/neovim/neovim/issues/17473 - add_map("<C-L>", "<Cmd>nohlsearch<Bar>diffupdate<Bar>normal! <C-L><CR>", - MODE_NORMAL, false); - add_map("<C-U>", "<C-G>u<C-U>", MODE_INSERT, false); - add_map("<C-W>", "<C-G>u<C-W>", MODE_INSERT, false); - add_map("*", "y/\\\\V<C-R>\"<CR>", MODE_VISUAL, false); - add_map("#", "y?\\\\V<C-R>\"<CR>", MODE_VISUAL, false); - - // Use : instead of <Cmd> so that ranges are supported (e.g. 3& repeats the substitution on the - // next 3 lines) - add_map("&", ":&&<CR>", MODE_NORMAL, false); -} - /// Add a mapping. Unlike @ref do_map this copies the string arguments, so /// static or read-only strings can be used. /// diff --git a/src/nvim/options.lua b/src/nvim/options.lua index addc08d560..9e4a6a084c 100644 --- a/src/nvim/options.lua +++ b/src/nvim/options.lua @@ -1597,7 +1597,7 @@ return { short_desc=N_("the use of mouse clicks"), type='string', list='flags', scope={'global'}, varname='p_mouse', - defaults={if_true=""} + defaults={if_true="nvi"} }, { full_name='mousefocus', abbreviation='mousef', @@ -1619,7 +1619,7 @@ return { short_desc=N_("changes meaning of mouse buttons"), type='string', scope={'global'}, varname='p_mousem', - defaults={if_true="extend"} + defaults={if_true="popup_setpos"} }, { full_name='mousescroll', |