mirror of
				https://github.com/Maks1mS/bubbles.git
				synced 2025-10-31 05:42:01 +03:00 
			
		
		
		
	Add cursor positioning functions to viewport renderder
This commit is contained in:
		| @@ -95,3 +95,11 @@ func clearLine(w io.Writer) { | |||||||
| func insertLine(w io.Writer, numLines int) { | func insertLine(w io.Writer, numLines int) { | ||||||
| 	fmt.Fprintf(w, te.CSI+"%dL", numLines) | 	fmt.Fprintf(w, te.CSI+"%dL", numLines) | ||||||
| } | } | ||||||
|  |  | ||||||
|  | func saveCursorPosition(w io.Writer) { | ||||||
|  | 	fmt.Fprint(w, te.CSI+"s") | ||||||
|  | } | ||||||
|  |  | ||||||
|  | func restoreCursorPosition(w io.Writer) { | ||||||
|  | 	fmt.Fprint(w, te.CSI+"u") | ||||||
|  | } | ||||||
|   | |||||||
| @@ -21,8 +21,8 @@ type Model struct { | |||||||
| 	// It's used in high performance rendering. | 	// It's used in high performance rendering. | ||||||
| 	Y int | 	Y int | ||||||
|  |  | ||||||
| 	// UseInternalRenderer specifies whether or not to use the pager's internal, | 	// UseInternalRenderer specifies whether or not to use the pager's | ||||||
| 	// high performance renderer to paint the screen. | 	// internal, high performance renderer to paint the screen. | ||||||
| 	UseInternalRenderer bool | 	UseInternalRenderer bool | ||||||
|  |  | ||||||
| 	lines []string | 	lines []string | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user