aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorluukvbaal <31730729+luukvbaal@users.noreply.github.com>2023-01-13 04:47:55 +0100
committerGitHub <noreply@github.com>2023-01-13 11:47:55 +0800
commit1097d239c307a10a87fa995c4cfbe5987939e177 (patch)
tree5f62191f140d2872e2001d58a2f7ea8ef009d340 /src
parent4876654d4cc9bb43f266c7c9d412f36ab57fa571 (diff)
downloadrneovim-1097d239c307a10a87fa995c4cfbe5987939e177.tar.gz
rneovim-1097d239c307a10a87fa995c4cfbe5987939e177.tar.bz2
rneovim-1097d239c307a10a87fa995c4cfbe5987939e177.zip
fix(ui): command line issues with external messages (#21709)
* fix: don't truncate external messages * fix: avoid resizing command line with external messages
Diffstat (limited to 'src')
-rw-r--r--src/nvim/message.c6
-rw-r--r--src/nvim/window.c14
2 files changed, 13 insertions, 7 deletions
diff --git a/src/nvim/message.c b/src/nvim/message.c
index e9d66ea184..de4acd601f 100644
--- a/src/nvim/message.c
+++ b/src/nvim/message.c
@@ -919,9 +919,11 @@ char *msg_trunc_attr(char *s, bool force, int attr)
/// @note: May change the message by replacing a character with '<'.
char *msg_may_trunc(bool force, char *s)
{
- int room;
+ if (ui_has(kUIMessages)) {
+ return s;
+ }
- room = (Rows - cmdline_row - 1) * Columns + sc_col - 1;
+ int room = (Rows - cmdline_row - 1) * Columns + sc_col - 1;
if ((force || (shortmess(SHM_TRUNC) && !exmode_active))
&& (int)strlen(s) - room > 0) {
int size = vim_strsize(s);
diff --git a/src/nvim/window.c b/src/nvim/window.c
index 37f297909a..2bcbef14b0 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -5780,6 +5780,10 @@ static void frame_setheight(frame_T *curfrp, int height)
if (curfrp->fr_parent == NULL) {
// topframe: can only change the command line height
+ // Avoid doing so with external messages.
+ if (ui_has(kUIMessages)) {
+ return;
+ }
if (height > ROWS_AVAIL) {
// If height is greater than the available space, try to create space for
// the frame by reducing 'cmdheight' if possible, while making sure
@@ -6115,13 +6119,13 @@ void win_setminwidth(void)
/// Status line of dragwin is dragged "offset" lines down (negative is up).
void win_drag_status_line(win_T *dragwin, int offset)
{
- // If the user explicitly set 'cmdheight' to zero, then allow for dragging
- // the status line making it zero again.
- if (p_ch == 0) {
- p_ch_was_zero = true;
+ frame_T *fr = dragwin->w_frame;
+
+ // Avoid changing command line height with external messages.
+ if (fr->fr_next == NULL && ui_has(kUIMessages)) {
+ return;
}
- frame_T *fr = dragwin->w_frame;
frame_T *curfr = fr;
if (fr != topframe) { // more than one window
fr = fr->fr_parent;