aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/api')
-rw-r--r--src/nvim/api/options.c3
-rw-r--r--src/nvim/api/ui.c6
2 files changed, 5 insertions, 4 deletions
diff --git a/src/nvim/api/options.c b/src/nvim/api/options.c
index e33cb72e8d..eb80683365 100644
--- a/src/nvim/api/options.c
+++ b/src/nvim/api/options.c
@@ -465,9 +465,6 @@ OptVal get_option_value_for(const char *const name, uint32_t *flagsp, int scope,
/// @param[in] name Option name.
/// @param[in] value Option value.
/// @param[in] opt_flags Flags: OPT_LOCAL, OPT_GLOBAL, or 0 (both).
-/// If OPT_CLEAR is set, the value of the option
-/// is cleared (the exact semantics of this depend
-/// on the option).
/// @param[in] opt_type Option type. See SREQ_* in option_defs.h.
/// @param[in] from Target buffer/window.
/// @param[out] err Error message, if any.
diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c
index 9fa5a89407..891c81d470 100644
--- a/src/nvim/api/ui.c
+++ b/src/nvim/api/ui.c
@@ -830,6 +830,7 @@ void remote_ui_raw_line(UI *ui, Integer grid, Integer row, Integer startcol, Int
size_t ncells = (size_t)(endcol - startcol);
int last_hl = -1;
uint32_t nelem = 0;
+ bool was_space = false;
for (size_t i = 0; i < ncells; i++) {
repeat++;
if (i == ncells - 1 || attrs[i] != attrs[i + 1]
@@ -868,9 +869,12 @@ void remote_ui_raw_line(UI *ui, Integer grid, Integer row, Integer startcol, Int
data->ncells_pending += MIN(repeat, 2);
last_hl = attrs[i];
repeat = 0;
+ was_space = strequal(chunk[i], " ");
}
}
- if (endcol < clearcol) {
+ // If the last chunk was all spaces, add a clearing chunk even if there are
+ // no more cells to clear, so there is no ambiguity about what to clear.
+ if (endcol < clearcol || was_space) {
nelem++;
data->ncells_pending += 1;
mpack_array(buf, 3);