helix-mirror/helix-term
Michael Davis ba394dca6d
Fix panic from two windows editing the same document (#4570)
* Clamp highlighting range to be within document

This fixes a panic possible when two vsplits of the same document
exist and enough lines are deleted from the document so that one of
the windows focuses past the end of the document.

* Ensure cursor is in view on window change

If two windows are editing the same document, one may delete enough of
the document so that the other window is pointing at a blank page (past
the document end). In this change we ensure that the cursor is within
view whenever we switch to a new window (for example with `<C-w>w`).

* Update helix-term/src/ui/editor.rs

Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>

Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
2022-11-03 15:09:21 +09:00
..
src Fix panic from two windows editing the same document (#4570) 2022-11-03 15:09:21 +09:00
tests Trim quotes and braces from paths in goto_file_impl (#4370) 2022-10-27 20:31:28 -05:00
.gitignore Initial import. 2020-05-20 18:14:51 +09:00
build.rs feat: support grammar cross-compilation 2022-08-02 12:04:09 +09:00
Cargo.toml build(deps): bump once_cell from 1.15.0 to 1.16.0 (#4548) 2022-10-31 19:31:08 -05:00