Do not save cursor in tresize.
This patch fixes the bug introduced in
8f11e1cd03
To reproduce the bug:
1. Save cursor: printf '\e[s'
2. Load cursor: printf '\e[u'
3. Resize st window.
4. Load cursor again: printf '\e[u'
			
			
This commit is contained in:
		
							parent
							
								
									5f91983541
								
							
						
					
					
						commit
						6b315558f8
					
				
							
								
								
									
										4
									
								
								st.c
								
								
								
								
							
							
						
						
									
										4
									
								
								st.c
								
								
								
								
							| 
						 | 
					@ -2634,6 +2634,7 @@ tresize(int col, int row) {
 | 
				
			||||||
	int slide = term.c.y - row + 1;
 | 
						int slide = term.c.y - row + 1;
 | 
				
			||||||
	bool *bp;
 | 
						bool *bp;
 | 
				
			||||||
	Line *orig;
 | 
						Line *orig;
 | 
				
			||||||
 | 
						TCursor c;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if(col < 1 || row < 1)
 | 
						if(col < 1 || row < 1)
 | 
				
			||||||
		return 0;
 | 
							return 0;
 | 
				
			||||||
| 
						 | 
					@ -2695,6 +2696,7 @@ tresize(int col, int row) {
 | 
				
			||||||
	tmoveto(term.c.x, term.c.y);
 | 
						tmoveto(term.c.x, term.c.y);
 | 
				
			||||||
	/* Clearing both screens */
 | 
						/* Clearing both screens */
 | 
				
			||||||
	orig = term.line;
 | 
						orig = term.line;
 | 
				
			||||||
 | 
						c = term.c;
 | 
				
			||||||
	do {
 | 
						do {
 | 
				
			||||||
		if(mincol < col && 0 < minrow) {
 | 
							if(mincol < col && 0 < minrow) {
 | 
				
			||||||
			tclearregion(mincol, 0, col - 1, minrow - 1);
 | 
								tclearregion(mincol, 0, col - 1, minrow - 1);
 | 
				
			||||||
| 
						 | 
					@ -2702,10 +2704,10 @@ tresize(int col, int row) {
 | 
				
			||||||
		if(0 < col && minrow < row) {
 | 
							if(0 < col && minrow < row) {
 | 
				
			||||||
			tclearregion(0, minrow, col - 1, row - 1);
 | 
								tclearregion(0, minrow, col - 1, row - 1);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		tcursor(CURSOR_SAVE);
 | 
					 | 
				
			||||||
		tswapscreen();
 | 
							tswapscreen();
 | 
				
			||||||
		tcursor(CURSOR_LOAD);
 | 
							tcursor(CURSOR_LOAD);
 | 
				
			||||||
	} while(orig != term.line);
 | 
						} while(orig != term.line);
 | 
				
			||||||
 | 
						term.c = c;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return (slide > 0);
 | 
						return (slide > 0);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue