billiob pushed a commit to branch master. http://git.enlightenment.org/apps/terminology.git/commit/?id=2f040f95320d88373e06bf9cfd988e26505090e3
commit 2f040f95320d88373e06bf9cfd988e26505090e3 Author: Boris Faure <[email protected]> Date: Fri May 29 23:05:21 2020 +0200 termiolink: handle tabs in (color) links --- src/bin/termiolink.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/src/bin/termiolink.c b/src/bin/termiolink.c index 0531f3b..5e90662 100644 --- a/src/bin/termiolink.c +++ b/src/bin/termiolink.c @@ -234,6 +234,13 @@ _txt_at(Termpty *ty, int *x, int *y, char *txt, int *txtlenp, int *codepointp) cell = cells[*x]; } + if (cell.att.tab_inserted) + { + *txtlenp = 1; + *codepointp = '\t'; + txt[0] = '\t'; + return 0; + } if ((cell.codepoint == 0) || (cell.att.link_id)) goto empty; @@ -298,6 +305,17 @@ _txt_prev_at(Termpty *ty, int *x, int *y, char *txt, int *txtlenp, cell = cells[*x]; } + if (cell.att.tab_last) + { + while (*x >= 0 && !cells[*x].att.tab_inserted) + (*x)--; + if (*x < 0) + goto bad; + *txtlenp = 1; + *codepointp = '\t'; + txt[0] = '\t'; + return 0; + } if ((cell.codepoint == 0) || (cell.att.link_id)) goto empty; @@ -313,8 +331,8 @@ empty: return 0; bad: - *txtlenp = 0; txt[0] = '\0'; + *txtlenp = 0; return -1; } @@ -365,6 +383,17 @@ _txt_next_at(Termpty *ty, int *x, int *y, char *txt, int *txtlenp, } cell = cells[*x]; + if (cell.att.tab_inserted) + { + while (*x < w && !cells[*x].att.tab_last) + (*x)++; + if (*x >= w) + goto bad; + *txtlenp = 1; + *codepointp = '\t'; + txt[0] = '\t'; + return 0; + } if ((cell.codepoint == 0) || (cell.att.link_id)) goto empty; --
