From 2cb8db34e3a275dec3dacb10fdc75640f4ec8174 Mon Sep 17 00:00:00 2001 From: Gregory Anders Date: Mon, 16 Aug 2021 19:28:52 -0600 Subject: feat: defaults: set undo points in and (#15400) --- src/nvim/getchar.c | 8 ++++++++ src/nvim/normal.c | 6 ------ src/nvim/testdir/setup.vim | 2 ++ 3 files changed, 10 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index 63da6f7922..4bf1c90830 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -841,6 +841,14 @@ static void init_typebuf(void) } } +void init_default_mappings(void) +{ + add_map((char_u *)"Y y$", NORMAL, true); + add_map((char_u *)" nohlsearchdiffupdate", NORMAL, true); + add_map((char_u *)" u", INSERT, true); + add_map((char_u *)" u", INSERT, true); +} + // Insert a string in position 'offset' in the typeahead buffer (for "@r" // and ":normal" command, vgetorpeek() and check_termcode()) // diff --git a/src/nvim/normal.c b/src/nvim/normal.c index f3869e7e44..2a530db934 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -397,12 +397,6 @@ void init_normal_cmds(void) nv_max_linear = i - 1; } -void init_default_mappings(void) -{ - add_map((char_u *)"Y y$", NORMAL, true); - add_map((char_u *)" nohlsearchdiffupdate", NORMAL, true); -} - /* * Search for a command in the commands table. * Returns -1 for invalid command. diff --git a/src/nvim/testdir/setup.vim b/src/nvim/testdir/setup.vim index 57ba57a3c8..58ce0f1a4c 100644 --- a/src/nvim/testdir/setup.vim +++ b/src/nvim/testdir/setup.vim @@ -27,6 +27,8 @@ set switchbuf= " Unmap Nvim default mappings. unmap Y unmap +iunmap +iunmap " Prevent Nvim log from writing to stderr. let $NVIM_LOG_FILE = exists($NVIM_LOG_FILE) ? $NVIM_LOG_FILE : 'Xnvim.log' -- cgit