mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	startup: fail if --embed with -es/-Es #10753
Closes https://github.com/neovim/neovim/issues/10031
This commit is contained in:
		 glacambre
					glacambre
				
			
				
					committed by
					
						 Justin M. Keyes
						Justin M. Keyes
					
				
			
			
				
	
			
			
			 Justin M. Keyes
						Justin M. Keyes
					
				
			
						parent
						
							3afb397407
						
					
				
				
					commit
					77594d55f7
				
			| @@ -1223,6 +1223,10 @@ scripterror: | |||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   if (embedded_mode && silent_mode) { | ||||||
|  |     mainerr(_("--embed conflicts with -es/-Es"), NULL); | ||||||
|  |   } | ||||||
|  |  | ||||||
|   // If there is a "+123" or "-c" command, set v:swapcommand to the first one. |   // If there is a "+123" or "-c" command, set v:swapcommand to the first one. | ||||||
|   if (parmp->n_commands > 0) { |   if (parmp->n_commands > 0) { | ||||||
|     const size_t swcmd_len = STRLEN(parmp->commands[0]) + 3; |     const size_t swcmd_len = STRLEN(parmp->commands[0]) + 3; | ||||||
|   | |||||||
| @@ -7403,3 +7403,6 @@ msgstr "" | |||||||
| "Source C (*.c, *.h)\t*.c;*.h\n" | "Source C (*.c, *.h)\t*.c;*.h\n" | ||||||
| "Source C++ (*.cpp, *.hpp)\t*.cpp;*.hpp\n" | "Source C++ (*.cpp, *.hpp)\t*.cpp;*.hpp\n" | ||||||
| "Fichiers Vim (*.vim, _vimrc, _gvimrc)\t*.vim;_vimrc;_gvimrc\n" | "Fichiers Vim (*.vim, _vimrc, _gvimrc)\t*.vim;_vimrc;_gvimrc\n" | ||||||
|  |  | ||||||
|  | msgid "--embed conflicts with -es/-Es" | ||||||
|  | msgstr "les param<61>tres -es/-ES sont incompatibles avec --embed" | ||||||
|   | |||||||
| @@ -217,6 +217,13 @@ describe('startup', function() | |||||||
|     end |     end | ||||||
|   end) |   end) | ||||||
|  |  | ||||||
|  |   it('fails on --embed with -es/-Es', function() | ||||||
|  |     eq('nvim: --embed conflicts with -es/-Es\nMore info with "nvim -h"\n', | ||||||
|  |       funcs.system({nvim_prog, '--embed', '-es' })) | ||||||
|  |     eq('nvim: --embed conflicts with -es/-Es\nMore info with "nvim -h"\n', | ||||||
|  |       funcs.system({nvim_prog, '--embed', '-Es' })) | ||||||
|  |   end) | ||||||
|  |  | ||||||
|   it('does not crash if --embed is given twice', function() |   it('does not crash if --embed is given twice', function() | ||||||
|     clear{args={'--embed'}} |     clear{args={'--embed'}} | ||||||
|     eq(2, eval('1+1')) |     eq(2, eval('1+1')) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user