Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport release-0.6] fix(terminal): fix resize crash with pending scrollback #16665

Merged
merged 1 commit into from
Dec 15, 2021

Conversation

github-actions[bot]
Copy link
Contributor

Description

Backport of #14891 to release-0.6.

refresh_scrollback assumes pending scrollback rows exist only if the
terminal window height decreased (or the screen was full).

However, after accumulating scrollback, it's possible in some cases for
the terminal height to increase before refresh_scrollback is called via
invalidation (especially when the terminal buffer isn't initially
displayed in a window before nvim_open_term), which may crash.

As we'll have enough room for some scrollback rows, just append them to
the top of the buffer until it fills the window, then continue with the
previous logic for any remaining scrollback rows if necessary.

(cherry picked from commit 669402e)
@gpanders gpanders merged commit ae249d8 into release-0.6 Dec 15, 2021
@gpanders gpanders deleted the backport-14891-to-release-0.6 branch December 15, 2021 15:29
bfredl added a commit that referenced this pull request Dec 31, 2021
Bug Fixes

  * api: allow nvim_buf_set_extmark to accept end_row key #16686 1b54344
  * diagnostic: assert that diagnostics have line number and column #16687 9dae939
  * diagnostic: clamp diagnostics on negative line numbers #16497 096f841
  * diagnostic: escape special chars in file names #16588 beac24d
  * diagnostic: respect "if_many" source option for virtual text #16697 060eeaa
  * diagnostic: set effective buffer number for DiagnosticChanged autocmd #16485 84784a8
  * diagnostic: set effective buffer number in autocmd (again) #16590 08ddfa9, closes #16474
  * lua: do not cast offset to char_u 93f1ec0
  * lsp: avoid attaching to unloaded buffers #16726 0088994
  * lsp: call config on_exit handler before context is cleared #16781 571609f
  * lsp: fix `nil`-index behavior for UTF-8 in `_str_*index_enc` methods #16785 03bd914
  * lsp: handle offset encoding #16783 7b60ec7
  * lsp: progress handlers should return vim.NIL on error #16476 fb11ef0
  * options: disallow empty 'fdc' and 'scl' #16776 37a00be
  * quickfix: avoid O(N^2) when filling from string typval #16663 aa0ddc6
  * screenpos, float: add top and left border adjustment 8f68548
  * terminal: fix resize crash with pending scrollback #16665 ae249d8
  * ui: close floating window on BufLeave event #16664 785bace
  * uri: change scheme pattern to not include the comma character #16798 0e96f7d

Features

  * lsp,diagnostic: open folds in jump-related functions #16784 ee9e342
  * lsp: add buf_detach_client #16741 ec101b9
  * lsp: use `vim.ui.select` for selecting lsp client #16782 14357c8
  * runtime: new checkhealth filetype #16708 09306f0
@dundargoc dundargoc mentioned this pull request Jan 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants