mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-04 01:34:25 +00:00 
			
		
		
		
	Add API vim_replace_termcodes
- Add API function to call replace_termcodes
This commit is contained in:
		
				
					committed by
					
						
						Thiago de Arruda
					
				
			
			
				
	
			
			
			
						parent
						
							1dea4044e7
						
					
				
				
					commit
					2875ad865b
				
			@@ -84,6 +84,24 @@ void vim_feedkeys(String keys, String mode)
 | 
				
			|||||||
    typebuf_was_filled = true;
 | 
					    typebuf_was_filled = true;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/// Replace any terminal codes with the internal representation
 | 
				
			||||||
 | 
					///
 | 
				
			||||||
 | 
					/// @see replace_termcodes
 | 
				
			||||||
 | 
					/// @see cpoptions
 | 
				
			||||||
 | 
					String vim_replace_termcodes(String str, Boolean from_part, Boolean do_lt,
 | 
				
			||||||
 | 
					                              Boolean special)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  if (str.size == 0) {
 | 
				
			||||||
 | 
					    // Empty string
 | 
				
			||||||
 | 
					    return str;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  char *ptr = NULL;
 | 
				
			||||||
 | 
					  replace_termcodes((char_u *)str.data, (char_u **)&ptr,
 | 
				
			||||||
 | 
					                                            from_part, do_lt, special);
 | 
				
			||||||
 | 
					  return cstr_as_string(ptr);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/// Evaluates the expression str using the vim internal expression
 | 
					/// Evaluates the expression str using the vim internal expression
 | 
				
			||||||
/// evaluator (see |expression|).
 | 
					/// evaluator (see |expression|).
 | 
				
			||||||
/// Dictionaries and lists are recursively expanded.
 | 
					/// Dictionaries and lists are recursively expanded.
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user