summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2019-10-27 16:04:43 +0100
committerBoris Faure <billiob@gmail.com>2019-10-27 16:04:43 +0100
commite1ff4d877e896254500d79b9e07cfafd9537112e (patch)
tree8559b1a65661d08b3c4c077cd6057868cf509a5c
parent7dcb9e4e43f5af67d3f989d9e69aa6f4a328d607 (diff)
termptyesc: store when tab are inserted and where they stop
-rw-r--r--src/bin/termpty.h8
-rw-r--r--src/bin/termptyesc.c6
-rw-r--r--src/bin/termptyops.c2
3 files changed, 13 insertions, 3 deletions
diff --git a/src/bin/termpty.h b/src/bin/termpty.h
index ef07cb9..ca1605c 100644
--- a/src/bin/termpty.h
+++ b/src/bin/termpty.h
@@ -81,12 +81,14 @@ struct _Termatt
81 unsigned short fraktur : 1; 81 unsigned short fraktur : 1;
82 unsigned short framed : 1; 82 unsigned short framed : 1;
83 unsigned short encircled : 1; 83 unsigned short encircled : 1;
84 unsigned short overlined : 1; 84 unsigned short overlined : 1; // TODO: support it
85 unsigned short tab_inserted : 1;
86 unsigned short tab_last : 1;
85#if defined(SUPPORT_80_132_COLUMNS) 87#if defined(SUPPORT_80_132_COLUMNS)
86 unsigned short is_80_132_mode_allowed : 1; 88 unsigned short is_80_132_mode_allowed : 1;
87 unsigned short bit_padding : 11; 89 unsigned short bit_padding : 9;
88#else 90#else
89 unsigned short bit_padding : 12; 91 unsigned short bit_padding : 10;
90#endif 92#endif
91 uint16_t link_id; 93 uint16_t link_id;
92}; 94};
diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c
index a92b4db..256c819 100644
--- a/src/bin/termptyesc.c
+++ b/src/bin/termptyesc.c
@@ -207,6 +207,8 @@ _cursor_to_start_of_line(Termpty *ty)
207static void 207static void
208_handle_cursor_control(Termpty *ty, const Eina_Unicode *cc) 208_handle_cursor_control(Termpty *ty, const Eina_Unicode *cc)
209{ 209{
210 Termcell *cell;
211
210 switch (*cc) 212 switch (*cc)
211 { 213 {
212 case 0x07: // BEL '\a' (bell) 214 case 0x07: // BEL '\a' (bell)
@@ -220,7 +222,11 @@ _handle_cursor_control(Termpty *ty, const Eina_Unicode *cc)
220 return; 222 return;
221 case 0x09: // HT '\t' (horizontal tab) 223 case 0x09: // HT '\t' (horizontal tab)
222 DBG("->HT"); 224 DBG("->HT");
225 cell = &(TERMPTY_SCREEN(ty, ty->cursor_state.cx, ty->cursor_state.cy));
226 cell->att.tab_inserted = 1;
223 _tab_forward(ty, 1); 227 _tab_forward(ty, 1);
228 cell = &(TERMPTY_SCREEN(ty, ty->cursor_state.cx -1, ty->cursor_state.cy));
229 cell->att.tab_last = 1;
224 return; 230 return;
225 case 0x0a: // LF '\n' (new line) 231 case 0x0a: // LF '\n' (new line)
226 case 0x0b: // VT '\v' (vertical tab) 232 case 0x0b: // VT '\v' (vertical tab)
diff --git a/src/bin/termptyops.c b/src/bin/termptyops.c
index dfc7558..27c4399 100644
--- a/src/bin/termptyops.c
+++ b/src/bin/termptyops.c
@@ -427,6 +427,8 @@ termpty_reset_att(Termatt *att)
427 att->framed = 0; 427 att->framed = 0;
428 att->encircled = 0; 428 att->encircled = 0;
429 att->overlined = 0; 429 att->overlined = 0;
430 att->tab_inserted = 0;
431 att->tab_last = 0;
430} 432}
431 433
432void 434void