mirror of
https://github.com/neovim/neovim
synced 2025-07-16 01:01:49 +00:00
feat(api): add nvim__redraw for more granular redrawing
Experimental and subject to future changes. Add a way to redraw certain elements that are not redrawn while Nvim is waiting for input, or currently have no API to do so. This API covers all that can be done with the :redraw* commands, in addition to the following new features: - Immediately move the cursor to a (non-current) window. - Target a specific window or buffer to mark for redraw. - Mark a buffer range for redraw (replaces nvim__buf_redraw_range()). - Redraw the 'statuscolumn'.
This commit is contained in:
@ -230,20 +230,6 @@ Boolean nvim_buf_detach(uint64_t channel_id, Buffer buffer, Error *err)
|
||||
return true;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
void nvim__buf_redraw_range(Buffer buffer, Integer first, Integer last, Error *err)
|
||||
{
|
||||
buf_T *buf = find_buffer_by_handle(buffer, err);
|
||||
if (!buf) {
|
||||
return;
|
||||
}
|
||||
if (last < 0) {
|
||||
last = buf->b_ml.ml_line_count;
|
||||
}
|
||||
|
||||
redraw_buf_range_later(buf, (linenr_T)first + 1, (linenr_T)last);
|
||||
}
|
||||
|
||||
/// Gets a line-range from the buffer.
|
||||
///
|
||||
/// Indexing is zero-based, end-exclusive. Negative indices are interpreted
|
||||
|
Reference in New Issue
Block a user