mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	vim-patch:8.2.4403: ml_get error with nested folds and deleting lines
Problem:    ml_get error with nested folds and deleting lines.
Solution:   Correct the last line number before calling hasFoldingWin().
9437737833
			
			
This commit is contained in:
		| @@ -223,19 +223,20 @@ static void changed_common(linenr_T lnum, colnr_T col, linenr_T lnume, long xtra | |||||||
|       // values for the cursor. |       // values for the cursor. | ||||||
|       // Update the folds for this window.  Can't postpone this, because |       // Update the folds for this window.  Can't postpone this, because | ||||||
|       // a following operator might work on the whole fold: ">>dd". |       // a following operator might work on the whole fold: ">>dd". | ||||||
|       foldUpdate(wp, lnum, lnume + xtra - 1); |       linenr_T last = lnume + xtra - 1;  // last line after the change | ||||||
|  |       foldUpdate(wp, lnum, last); | ||||||
|  |  | ||||||
|       // The change may cause lines above or below the change to become |       // The change may cause lines above or below the change to become | ||||||
|       // included in a fold.  Set lnum/lnume to the first/last line that |       // included in a fold.  Set lnum/lnume to the first/last line that | ||||||
|       // might be displayed differently. |       // might be displayed differently. | ||||||
|       // Set w_cline_folded here as an efficient way to update it when |       // Set w_cline_folded here as an efficient way to update it when | ||||||
|       // inserting lines just above a closed fold. */ |       // inserting lines just above a closed fold. | ||||||
|       bool folded = hasFoldingWin(wp, lnum, &lnum, NULL, false, NULL); |       bool folded = hasFoldingWin(wp, lnum, &lnum, NULL, false, NULL); | ||||||
|       if (wp->w_cursor.lnum == lnum) { |       if (wp->w_cursor.lnum == lnum) { | ||||||
|         wp->w_cline_folded = folded; |         wp->w_cline_folded = folded; | ||||||
|       } |       } | ||||||
|       folded = hasFoldingWin(wp, lnume, NULL, &lnume, false, NULL); |       folded = hasFoldingWin(wp, last, NULL, &last, false, NULL); | ||||||
|       if (wp->w_cursor.lnum == lnume) { |       if (wp->w_cursor.lnum == last) { | ||||||
|         wp->w_cline_folded = folded; |         wp->w_cline_folded = folded; | ||||||
|       } |       } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Sean Dewar
					Sean Dewar