This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch tymux-10-quiet-head
in repository terminology.
View the commit online.
commit 3418b421bb3410b28de4982649dc5b2a53d2dd3e
Author: Boris Faure <[email protected]>
AuthorDate: Wed Nov 11 19:39:33 2026 +0000
termptyops: take the ASCII run path in insert mode too
Under IRM every character shifted the rest of its row, so a word or a
REP of n cells moved the row n times. A run written at the cursor
pushes the row right by its length, and the cells pushed past the
margin are lost either way, so shifting once by the run's length and
writing it leaves the row as n single inserts do. With that, insert
mode no longer has to keep text off the ASCII run path.
---
src/bin/termptyops.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/src/bin/termptyops.c b/src/bin/termptyops.c
index 0aaec5c6..2958cb5c 100644
--- a/src/bin/termptyops.c
+++ b/src/bin/termptyops.c
@@ -255,8 +255,6 @@ _append_fast_ok(const Termpty *ty)
return EINA_FALSE;
if (ty->termstate.att.fraktur || ty->termstate.att.encircled)
return EINA_FALSE;
- /* Insert mode shifts the rest of the line for every character. */
- if (ty->termstate.insert) return EINA_FALSE;
/* Autowrap off clamps the cursor instead of wrapping it, with different
* enough semantics that it is not worth duplicating here. */
if (!ty->termstate.wrap) return EINA_FALSE;
@@ -418,11 +416,6 @@ termpty_text_append_known_ascii(Termpty *ty, const Eina_Unicode *codepoints,
cells = &(TERMPTY_SCREEN(ty, 0, ty->cursor_state.cy));
wrapped = EINA_TRUE;
}
- if (ty->termstate.insert && (ty->cursor_state.cx < max_right - 1))
- TERMPTY_CELL_MOVE(ty, &(cells[ty->cursor_state.cx]),
- &(cells[ty->cursor_state.cx + 1]),
- max_right - 1 - ty->cursor_state.cx);
-
/* Not on an iteration that just wrapped: max_right was computed above
* from the pre-wrap cursor, and a whole run written against that stale
* value would sail past the right margin. */
@@ -441,6 +434,11 @@ termpty_text_append_known_ascii(Termpty *ty, const Eina_Unicode *codepoints,
if (run > (size_t)avail) run = (size_t)avail;
if (run >= 2)
{
+ /* one shift for the run, as many as it has cells */
+ if (ty->termstate.insert)
+ TERMPTY_CELL_MOVE(ty, &(cells[ty->cursor_state.cx]),
+ &(cells[ty->cursor_state.cx + run]),
+ avail - (int)run);
_append_ascii_run(ty, cells, codepoints + i, (int)run,
max_right);
i += (int)run - 1;
@@ -449,6 +447,11 @@ termpty_text_append_known_ascii(Termpty *ty, const Eina_Unicode *codepoints,
}
}
+ if (ty->termstate.insert && (ty->cursor_state.cx < max_right - 1))
+ TERMPTY_CELL_MOVE(ty, &(cells[ty->cursor_state.cx]),
+ &(cells[ty->cursor_state.cx + 1]),
+ max_right - 1 - ty->cursor_state.cx);
+
/* Skip 0-width space or RTL/LTR marks */
if (EINA_UNLIKELY(g >= 0x200b && g <= 0x200f))
{
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.