mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	vim-patch:9.1.1263: string length wrong in get_last_inserted_save() (#33194)
Problem:  string length wrong in get_last_inserted_save()
          (after v9.1.1222)
Solution: when removing trailing ESC, also decrease the string length
          (Christ van Willegen)
closes: vim/vim#16961
583f5aee96
Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
			
			
This commit is contained in:
		| @@ -2774,7 +2774,7 @@ char *get_last_insert_save(void) | |||||||
|  |  | ||||||
|   char *s = xmemdupz(insert.data, insert.size); |   char *s = xmemdupz(insert.data, insert.size); | ||||||
|   if (insert.size > 0 && s[insert.size - 1] == ESC) {  // remain trailing ESC |   if (insert.size > 0 && s[insert.size - 1] == ESC) {  // remain trailing ESC | ||||||
|     s[insert.size - 1] = NUL; |     s[--insert.size] = NUL; | ||||||
|   } |   } | ||||||
|   return s; |   return s; | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 zeertzjq
					zeertzjq