aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2023-05-24 10:04:49 +0200
committerGitHub <noreply@github.com>2023-05-24 10:04:49 +0200
commitc855eee919f2d4edc9b9fa91b277454290fbabfe (patch)
tree8dca8e4d1c239594dbb4e20d24ee3ebb63a2d9c3
parent6661cdf2bdfc2a9cd9805c7afd6d6ae556a50126 (diff)
downloadrneovim-c855eee919f2d4edc9b9fa91b277454290fbabfe.tar.gz
rneovim-c855eee919f2d4edc9b9fa91b277454290fbabfe.tar.bz2
rneovim-c855eee919f2d4edc9b9fa91b277454290fbabfe.zip
feat(term): enable reflow by default (#21124)
libvterm v0.3 supports reflow of terminal buffer when Nvim is resized Since v0.3 is now a required dependency, enable it by default to find (and fix) possible issues. Note: Neovim's scrollback buffer does not support reflow (yet), so lines vanishing into the buffer due to a too small window will be restored without reflow.
-rw-r--r--cmake.deps/deps.txt4
-rw-r--r--runtime/doc/news.txt4
-rw-r--r--runtime/doc/options.txt3
-rw-r--r--src/nvim/terminal.c1
-rw-r--r--test/functional/terminal/window_spec.lua4
5 files changed, 12 insertions, 4 deletions
diff --git a/cmake.deps/deps.txt b/cmake.deps/deps.txt
index 45275cc884..1a720bc1f3 100644
--- a/cmake.deps/deps.txt
+++ b/cmake.deps/deps.txt
@@ -16,8 +16,8 @@ UNIBILIUM_SHA256 9c4747c862ab5e3076dcf8fa8f0ea7a6b50f20ec5905618b953665559679748
LIBTERMKEY_URL https://github.com/neovim/deps/raw/aa004f1b2b6470a92363cba8e1cc1874141dacc4/opt/libtermkey-0.22.tar.gz
LIBTERMKEY_SHA256 6945bd3c4aaa83da83d80a045c5563da4edd7d0374c62c0d35aec09eb3014600
-LIBVTERM_URL https://github.com/neovim/deps/raw/aa004f1b2b6470a92363cba8e1cc1874141dacc4/opt/libvterm-0.3.1.tar.gz
-LIBVTERM_SHA256 25a8ad9c15485368dfd0a8a9dca1aec8fea5c27da3fa74ec518d5d3787f0c397
+LIBVTERM_URL https://github.com/neovim/deps/raw/6c0a5213d062f2210fd5fecb9524ac27ca018ef4/opt/libvterm-0.3.2.tar.gz
+LIBVTERM_SHA256 91eb5088069f4e6edab69e14c4212f6da0192e65695956dc048016a0dab8bcf6
LUV_URL https://github.com/luvit/luv/archive/c1497c0ffd3e1400a137ac99a614159a685f716b.tar.gz
LUV_SHA256 fc8c8c777454b78e09c06bd177860da9b79804affc967b015ecccb75b3af6893
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 5690dbf3bc..795ccc55de 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -58,6 +58,10 @@ The following new APIs or features were added.
• Added inline virtual text support to |nvim_buf_set_extmark()|.
+• The terminal buffer now supports reflow (wrapped lines adapt when the buffer
+ is resized horizontally). Note: Lines that are not visible and kept in
+ |'scrollback'| are not reflown.
+
==============================================================================
CHANGED FEATURES *news-changed*
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index c1e0bccfd3..72463af418 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -4913,6 +4913,9 @@ A jump table for the options with a short description can be found at |Q_op|.
Minimum is 1, maximum is 100000.
Only in |terminal| buffers.
+ Note: Lines that are not visible and kept in scrollback are not
+ reflown when the terminal buffer is resized horizontally.
+
*'scrollbind'* *'scb'* *'noscrollbind'* *'noscb'*
'scrollbind' 'scb' boolean (default off)
local to window
diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c
index 62a2d1b6e6..792071963d 100644
--- a/src/nvim/terminal.c
+++ b/src/nvim/terminal.c
@@ -220,6 +220,7 @@ Terminal *terminal_open(buf_T *buf, TerminalOptions opts)
// Set up screen
rv->vts = vterm_obtain_screen(rv->vt);
vterm_screen_enable_altscreen(rv->vts, true);
+ vterm_screen_enable_reflow(rv->vts, true);
// delete empty lines at the end of the buffer
vterm_screen_set_callbacks(rv->vts, &vterm_screen_callbacks, rv);
vterm_screen_set_damage_merge(rv->vts, VTERM_DAMAGE_SCROLL);
diff --git a/test/functional/terminal/window_spec.lua b/test/functional/terminal/window_spec.lua
index 80e9d78400..f90e4f7e9d 100644
--- a/test/functional/terminal/window_spec.lua
+++ b/test/functional/terminal/window_spec.lua
@@ -64,7 +64,7 @@ describe(':terminal window', function()
{7: 1 }tty ready |
{7: 2 }rows: 6, cols: 48 |
{7: 3 }abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO|
- {7: 4 }WXYZrows: 6, cols: 41 |
+ {7: 4 }PQRSTUVWXYZrows: 6, cols: 41 |
{7: 5 }{1: } |
{7: 6 } |
{3:-- TERMINAL --} |
@@ -74,7 +74,7 @@ describe(':terminal window', function()
{7: 1 }tty ready |
{7: 2 }rows: 6, cols: 48 |
{7: 3 }abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO|
- {7: 4 }WXYZrows: 6, cols: 41 |
+ {7: 4 }PQRSTUVWXYZrows: 6, cols: 41 |
{7: 5 } abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN|
{7: 6 }OPQRSTUVWXYZ{1: } |
{3:-- TERMINAL --} |