mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	vim-patch:9.0.1545: text not scrolled when cursor moved with "g0" and "h" (#23599)
Problem:    Text not scrolled when cursor moved with "g0" and "h".
Solution:   Adjust w_skipcol when needed. (Luuk van Baal, closes vim/vim#12387)
8667a5678f
			
			
This commit is contained in:
		| @@ -2527,6 +2527,7 @@ int oneleft(void) | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     curwin->w_set_curswant = true; |     curwin->w_set_curswant = true; | ||||||
|  |     adjust_skipcol(); | ||||||
|     return OK; |     return OK; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -5272,6 +5272,7 @@ static void nv_g_home_m_cmd(cmdarg_T *cap) | |||||||
|     curwin->w_valid &= ~VALID_WCOL; |     curwin->w_valid &= ~VALID_WCOL; | ||||||
|   } |   } | ||||||
|   curwin->w_set_curswant = true; |   curwin->w_set_curswant = true; | ||||||
|  |   adjust_skipcol(); | ||||||
| } | } | ||||||
|  |  | ||||||
| /// "g_": to the last non-blank character in the line or <count> lines downward. | /// "g_": to the last non-blank character in the line or <count> lines downward. | ||||||
|   | |||||||
| @@ -419,6 +419,18 @@ func Test_smoothscroll_cursor_position() | |||||||
|   exe "normal \<C-Y>" |   exe "normal \<C-Y>" | ||||||
|   call s:check_col_calc(1, 3, 41) |   call s:check_col_calc(1, 3, 41) | ||||||
|  |  | ||||||
|  |    " Test "g0/g<Home>" | ||||||
|  |   exe "normal gg\<C-E>" | ||||||
|  |   norm $gkg0 | ||||||
|  |   call s:check_col_calc(1, 2, 21) | ||||||
|  |  | ||||||
|  |   " Test moving the cursor behind the <<< display with 'virtualedit' | ||||||
|  |   set virtualedit=all | ||||||
|  |   exe "normal \<C-E>" | ||||||
|  |   norm 3lgkh | ||||||
|  |   call s:check_col_calc(3, 2, 23) | ||||||
|  |   set virtualedit& | ||||||
|  |  | ||||||
|   normal gg3l |   normal gg3l | ||||||
|   exe "normal \<C-E>" |   exe "normal \<C-E>" | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 luukvbaal
					luukvbaal