[vte] emulation: Port CUB, CUF to new parameter glue
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte] emulation: Port CUB, CUF to new parameter glue
- Date: Tue, 27 Mar 2018 17:42:48 +0000 (UTC)
commit fcbe649e7b04c584af56ece29060f450cad635d3
Author: Christian Persch <chpe src gnome org>
Date: Tue Mar 27 19:40:12 2018 +0200
emulation: Port CUB, CUF to new parameter glue
src/vteseq-list.hh | 2 --
src/vteseq.cc | 26 ++++++++------------------
2 files changed, 8 insertions(+), 20 deletions(-)
---
diff --git a/src/vteseq-list.hh b/src/vteseq-list.hh
index bb87abf..37b2b2d 100644
--- a/src/vteseq-list.hh
+++ b/src/vteseq-list.hh
@@ -31,8 +31,6 @@ SEQUENCE_HANDLER(change_tek_cursor_color_st)
SEQUENCE_HANDLER(change_tek_foreground_color_bel)
SEQUENCE_HANDLER(change_tek_foreground_color_st)
SEQUENCE_HANDLER(cursor_back_tab)
-SEQUENCE_HANDLER(cursor_backward)
-SEQUENCE_HANDLER(cursor_forward)
SEQUENCE_HANDLER(cursor_forward_tabulation)
SEQUENCE_HANDLER(cursor_lower_left)
SEQUENCE_HANDLER(cursor_preceding_line)
diff --git a/src/vteseq.cc b/src/vteseq.cc
index 616c738..ec8c78c 100644
--- a/src/vteseq.cc
+++ b/src/vteseq.cc
@@ -1412,14 +1412,6 @@ VteTerminalPrivate::seq_backspace(vte::parser::Params const& params)
}
}
-/* Cursor left N columns. */
-void
-VteTerminalPrivate::seq_cursor_backward(vte::parser::Params const& params)
-{
- auto val = params.number_or_default_at(0, 1);
- move_cursor_backward(val);
-}
-
void
VteTerminalPrivate::move_cursor_backward(vte::grid::column_t columns)
{
@@ -1430,14 +1422,6 @@ VteTerminalPrivate::move_cursor_backward(vte::grid::column_t columns)
set_cursor_column(col - columns);
}
-/* Cursor right N columns. */
-void
-VteTerminalPrivate::seq_cursor_forward(vte::parser::Params const& params)
-{
- auto val = params.number_or_default_at(0, 1);
- move_cursor_forward(val);
-}
-
void
VteTerminalPrivate::move_cursor_forward(vte::grid::column_t columns)
{
@@ -2941,6 +2925,8 @@ VteTerminalPrivate::CUB(vte::parser::Sequence const& seq)
*
* Defaults:
* args[0]: 1
+ *
+ * References: ECMA-48 § 8.3.18
*/
#if 0
unsigned int num = 1;
@@ -2952,7 +2938,8 @@ VteTerminalPrivate::CUB(vte::parser::Sequence const& seq)
screen_cursor_left(screen, num);
#endif
- seq_cursor_backward(seq);
+ auto value = seq.collect1(0, 1);
+ move_cursor_backward(value);
}
void
@@ -2993,6 +2980,8 @@ VteTerminalPrivate::CUF(vte::parser::Sequence const& seq)
*
* Defaults:
* args[0]: 1
+ *
+ * References: ECMA-48 § 8.3.20
*/
#if 0
unsigned int num = 1;
@@ -3004,7 +2993,8 @@ VteTerminalPrivate::CUF(vte::parser::Sequence const& seq)
screen_cursor_right(screen, num);
#endif
- seq_cursor_forward(seq);
+ auto value = seq.collect1(0, 1);
+ move_cursor_forward(value);
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]