diff options
| author | Maxime Coste <mawww@kakoune.org> | 2017-12-15 08:17:35 +1100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2017-12-15 08:17:35 +1100 |
| commit | cafecda230c974a50ee200c5047fa76a096d1474 (patch) | |
| tree | 162624037e8732bae0c16757fe3c386c35d71f56 /src | |
| parent | 43d2e12c0e652870fa5a290ceec42f9a19bef6c6 (diff) | |
Window: avoid positionning window on a negative column
Fixes #1741
Diffstat (limited to 'src')
| -rw-r--r-- | src/window.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/window.cc b/src/window.cc index bf4c1e08..b64d0fae 100644 --- a/src/window.cc +++ b/src/window.cc @@ -204,7 +204,8 @@ DisplaySetup Window::compute_display_setup(const Context& context) // now ensure the cursor column is visible { - auto underflow = setup.cursor_pos.column - setup.scroll_offset.column; + auto underflow = std::max(-setup.window_pos.column, + setup.cursor_pos.column - setup.scroll_offset.column); if (underflow < 0) { setup.window_pos.column += underflow; |
