mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
screen.c: make negative 'writedelay' show all redraws
Currently writedelay shows the sequence of characters that are sent to the UI/TUI module. Here nvim has already applied an optimization: when attempting to put a char in a screen cell, if the same char already was there with the same attributes, UI output is disabled. When debugging redrawing it it sometimes more useful to inspect the redraw stream one step earlier, what region of the screen nvim actually is recomputing from buffer contents (win_line) and from evaluating statusline expressions. Take the popupmenu as an example. When closing the popupmenu (in the TUI), currently 'writedelay' looks like vim only is redrawing the region which the pum covered. This is not what happens internally: vim redraws the entire screen, even if only outputs the changed region. This commit allows negative values of 'writedelay', which causes a delay for all redrawn characters, even if the character already was displayed by the UI before.
This commit is contained in:
parent
f3f1970597
commit
e18177692a
@ -6922,7 +6922,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
'writedelay' 'wd' number (default 0)
|
'writedelay' 'wd' number (default 0)
|
||||||
global
|
global
|
||||||
The number of milliseconds to wait for each character sent to the
|
The number of milliseconds to wait for each character sent to the
|
||||||
screen. When non-zero, characters are sent to the terminal one by
|
screen. When positive, characters are sent to the UI one by one.
|
||||||
one. For debugging purposes.
|
When negative, all redrawn characters cause a delay, even if the
|
||||||
|
character already was displayed by the UI. For debugging purposes.
|
||||||
|
|
||||||
vim:tw=78:ts=8:ft=help:noet:norl:
|
vim:tw=78:ts=8:ft=help:noet:norl:
|
||||||
|
@ -4361,7 +4361,8 @@ static int char_needs_redraw(int off_from, int off_to, int cols)
|
|||||||
&& comp_char_differs(off_from, off_to))
|
&& comp_char_differs(off_from, off_to))
|
||||||
|| ((*mb_off2cells)(off_from, off_from + cols) > 1
|
|| ((*mb_off2cells)(off_from, off_from + cols) > 1
|
||||||
&& ScreenLines[off_from + 1]
|
&& ScreenLines[off_from + 1]
|
||||||
!= ScreenLines[off_to + 1])))));
|
!= ScreenLines[off_to + 1])))
|
||||||
|
|| p_wd < 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -437,9 +437,8 @@ void ui_puts(uint8_t *str)
|
|||||||
|
|
||||||
if (p_wd) { // 'writedelay': flush & delay each time.
|
if (p_wd) { // 'writedelay': flush & delay each time.
|
||||||
ui_flush();
|
ui_flush();
|
||||||
assert(p_wd >= 0
|
uint64_t wd = (uint64_t)labs(p_wd);
|
||||||
&& (sizeof(long) <= sizeof(uint64_t) || p_wd <= UINT64_MAX));
|
os_delay(wd, false);
|
||||||
os_delay((uint64_t)p_wd, false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user