Fix softwrap scrolling issues (#1981)

Softwrap implementation enhanced to fix various issues with scrolling,
centering, relocating etc.

The main idea is simple: work not with simple line numbers but
with (Line, Row) pairs, where Line is a line number in the buffer
and Row is a visual line (a row) number within this line.
The logic remains mostly the same, but simple arithmetic operations
on line numbers are replaced with corresponding operations on
(Line, Row) pairs.

Fixes #632, #1657
This commit is contained in:
Dmitry Maluka
2021-04-07 22:18:51 +02:00
committed by GitHub
parent 6f949fe985
commit c5798b5b8c
8 changed files with 240 additions and 111 deletions

View File

@@ -259,6 +259,7 @@ The packages and functions are listed below (in Go type signatures):
- `MTError` error message.
- `Loc(x, y int) Loc`: creates a new location struct.
- `SLoc(line, row int) display.SLoc`: creates a new scrolling location struct.
- `BTDefault`: default buffer type.
- `BTLog`: log buffer type.