mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-04 01:34:25 +00:00 
			
		
		
		
	refactor(misc1): move insertmode related function to edit.c
This commit is contained in:
		@@ -832,6 +832,16 @@ static int insert_execute(VimState *state, int key)
 | 
				
			|||||||
  return insert_handle_key(s);
 | 
					  return insert_handle_key(s);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/// Return true when need to go to Insert mode because of 'insertmode'.
 | 
				
			||||||
 | 
					///
 | 
				
			||||||
 | 
					/// Don't do this when still processing a command or a mapping.
 | 
				
			||||||
 | 
					/// Don't do this when inside a ":normal" command.
 | 
				
			||||||
 | 
					bool goto_im(void)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  return p_im && stuff_empty() && typebuf_typed();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static int insert_handle_key(InsertState *s)
 | 
					static int insert_handle_key(InsertState *s)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  // The big switch to handle a character in insert mode.
 | 
					  // The big switch to handle a character in insert mode.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -437,13 +437,3 @@ done:
 | 
				
			|||||||
  xfree(tempname);
 | 
					  xfree(tempname);
 | 
				
			||||||
  return buffer;
 | 
					  return buffer;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					 | 
				
			||||||
/*
 | 
					 | 
				
			||||||
 * Return TRUE when need to go to Insert mode because of 'insertmode'.
 | 
					 | 
				
			||||||
 * Don't do this when still processing a command or a mapping.
 | 
					 | 
				
			||||||
 * Don't do this when inside a ":normal" command.
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
int goto_im(void)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
  return p_im && stuff_empty() && typebuf_typed();
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user