Commit be67c88
committed
Fix viewport jumping to top after exiting vim/less; bump to 1.2.6
The auto-scroll-restore logic in dataReceived didn't account for the
alternate screen buffer. While in vim/less the alt buffer's yDisp is 0,
so wasInScrollback (preYDisp < latestYBase) evaluated true the whole
time. On exit, the buffer switch back to normal happens inside
super.dataReceived, then the stale wasInScrollback==true ran
scrollTo(row: 0) on the now-active normal buffer, snapping it to the top.
Guard all scroll bookkeeping behind staying on the normal buffer for the
whole chunk, and re-read terminal.buffer fresh after super instead of
using a captured (potentially stale alt-buffer) reference.1 parent c8dcb84 commit be67c88
2 files changed
Lines changed: 19 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
293 | | - | |
| 293 | + | |
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
333 | | - | |
| 333 | + | |
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
264 | | - | |
265 | | - | |
266 | | - | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
267 | 271 | | |
268 | 272 | | |
269 | 273 | | |
270 | 274 | | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
271 | 283 | | |
272 | 284 | | |
273 | | - | |
274 | | - | |
| 285 | + | |
| 286 | + | |
275 | 287 | | |
276 | 288 | | |
277 | 289 | | |
| |||
0 commit comments