refactor(grid): reimplement 'rightleft' as a post-processing step

problem: checks for wp->w_p_rl are all over the place, making simple
things like "advance column one cell" incredibly complicated.

solution: always fill linebuf_char[] using an incrementing counter,
and then mirror the buffer as a post-processing step

This was "easier" that I first feared, because the stupid but simple
workaround for things like keeping linenumbers still left-right,
e.g. "mirror them and them mirror them once more" is more or less
what vim did already. So let's just keep doing that.
This commit is contained in:
bfredl
2023-11-03 20:25:52 +01:00
parent acc646ad8f
commit 83db9115af
4 changed files with 97 additions and 199 deletions

View File

@@ -566,7 +566,7 @@ void spell_suggest(int count)
}
vim_snprintf(IObuff, IOSIZE, "%2d", i + 1);
if (cmdmsg_rl) {
rl_mirror_ascii(IObuff);
rl_mirror_ascii(IObuff, NULL);
}
msg_puts(IObuff);
@@ -592,7 +592,7 @@ void spell_suggest(int count)
}
if (cmdmsg_rl) {
// Mirror the numbers, but keep the leading space.
rl_mirror_ascii(IObuff + 1);
rl_mirror_ascii(IObuff + 1, NULL);
}
msg_advance(30);
msg_puts(IObuff);