implemented backindex

pull/111/merge
Ondřej Hruška 7 years ago
parent 116201e232
commit 6fdb23531b
  1. 8
      user/apars_csi.c
  2. 3
      user/apars_osc.c
  3. 4
      user/apars_short.c
  4. 15
      user/screen.c
  5. 2
      user/screen.h

@ -562,6 +562,14 @@ do_csi_set_option(CSI_Data *opts)
else if (n == 20) { else if (n == 20) {
screen_set_newline_mode(yn); screen_set_newline_mode(yn);
} }
else if (n == 33) {
ansi_noimpl("Steady cursor");
// reference https://ttssh2.osdn.jp/manual/en/about/ctrlseq.html
}
else if (n == 34) {
ansi_noimpl("Underline cursor");
// reference https://ttssh2.osdn.jp/manual/en/about/ctrlseq.html
}
else { else {
ansi_noimpl("OPTION %d", n); ansi_noimpl("OPTION %d", n);
} }

@ -22,7 +22,6 @@
void ICACHE_FLASH_ATTR void ICACHE_FLASH_ATTR
apars_handle_osc(const char *buffer) apars_handle_osc(const char *buffer)
{ {
const char *orig_buff = buffer;
int n = 0; int n = 0;
char c = 0; char c = 0;
while ((c = *buffer++) != 0) { while ((c = *buffer++) != 0) {
@ -50,7 +49,7 @@ apars_handle_osc(const char *buffer)
} }
} }
else { else {
ansi_warn("BAD OSC: %s", orig_buff); ansi_warn("BAD OSC: %s", buffer);
apars_show_context(); apars_show_context();
} }
} }

@ -121,6 +121,10 @@ void ICACHE_FLASH_ATTR apars_handle_short_cmd(char c)
screen_reset(); screen_reset();
break; break;
case '6': // back index
screen_back_index(1);
break;
case '7': // save cursor + attributes case '7': // save cursor + attributes
screen_cursor_save(true); screen_cursor_save(true);
break; break;

@ -919,6 +919,21 @@ screen_cursor_restore(bool withAttrs)
NOTIFY_DONE(); NOTIFY_DONE();
} }
void ICACHE_FLASH_ATTR
screen_back_index(int count)
{
NOTIFY_LOCK();
int new_x = cursor.x - count;
if (new_x >= 0) {
cursor.x = new_x;
} else {
cursor.x = 0;
screen_insert_characters(-new_x);
}
NOTIFY_DONE();
}
//endregion //endregion
//region --- Attribute setting --- //region --- Attribute setting ---

@ -254,6 +254,8 @@ void screen_clear_tab(void);
void screen_tab_forward(int count); void screen_tab_forward(int count);
/** Move backward one tab */ /** Move backward one tab */
void screen_tab_reverse(int count); void screen_tab_reverse(int count);
/** Move left, shift right if at the boundary */
void screen_back_index(int count);
// --- Printing characters --- // --- Printing characters ---

Loading…
Cancel
Save