mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	fix(options): do not change inccommand during preview (#25462)
This commit is contained in:
		| @@ -1569,6 +1569,9 @@ const char *did_set_iconstring(optset_T *args) | ||||
| /// The 'inccommand' option is changed. | ||||
| const char *did_set_inccommand(optset_T *args FUNC_ATTR_UNUSED) | ||||
| { | ||||
|   if (cmdpreview) { | ||||
|     return e_invarg; | ||||
|   } | ||||
|   return did_set_opt_strings(p_icm, p_icm_values, false); | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -3167,3 +3167,31 @@ it("with 'inccommand' typing :filter doesn't segfault or leak memory #19057", fu | ||||
|   feed('i') | ||||
|   assert_alive() | ||||
| end) | ||||
|  | ||||
| it("'inccommand' cannot be changed during preview #23136", function() | ||||
|   clear() | ||||
|   local screen = Screen.new(30, 6) | ||||
|   common_setup(screen, 'nosplit', 'foo\nbar\nbaz') | ||||
|   source([[ | ||||
|     function! IncCommandToggle() | ||||
|       let prev = &inccommand | ||||
|  | ||||
|       if &inccommand ==# 'split' | ||||
|         set inccommand=nosplit | ||||
|       elseif &inccommand ==# 'nosplit' | ||||
|         set inccommand=split | ||||
|       elseif &inccommand ==# '' | ||||
|         set inccommand=nosplit | ||||
|       else | ||||
|         throw 'unknown inccommand' | ||||
|       endif | ||||
|  | ||||
|       return " \<BS>" | ||||
|     endfun | ||||
|  | ||||
|     cnoremap <expr> <C-E> IncCommandToggle() | ||||
|   ]]) | ||||
|  | ||||
|   feed(':%s/foo/bar<C-E><C-E><C-E>') | ||||
|   assert_alive() | ||||
| end) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Omar El Halabi
					Omar El Halabi