[vte] emulation: Port CNL, CUD to new parameter glue



commit b28f3dceb4b7aad6de98d966ee8fbd30fb66d010
Author: Christian Persch <chpe src gnome org>
Date:   Tue Mar 27 19:40:12 2018 +0200

    emulation: Port CNL, CUD to new parameter glue

 src/vteseq-list.hh |    2 --
 src/vteseq.cc      |   28 ++++++++++------------------
 2 files changed, 10 insertions(+), 20 deletions(-)
---
diff --git a/src/vteseq-list.hh b/src/vteseq-list.hh
index 10965c4..bb87abf 100644
--- a/src/vteseq-list.hh
+++ b/src/vteseq-list.hh
@@ -32,11 +32,9 @@ 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_down)
 SEQUENCE_HANDLER(cursor_forward)
 SEQUENCE_HANDLER(cursor_forward_tabulation)
 SEQUENCE_HANDLER(cursor_lower_left)
-SEQUENCE_HANDLER(cursor_next_line)
 SEQUENCE_HANDLER(cursor_preceding_line)
 SEQUENCE_HANDLER(cursor_up)
 SEQUENCE_HANDLER(dec_media_copy)
diff --git a/src/vteseq.cc b/src/vteseq.cc
index f2b67ea..616c738 100644
--- a/src/vteseq.cc
+++ b/src/vteseq.cc
@@ -1224,14 +1224,6 @@ VteTerminalPrivate::set_scrolling_region(vte::grid::row_t start /* relative */,
         home_cursor();
 }
 
-/* Move the cursor to the beginning of the Nth next line, no scrolling. */
-void
-VteTerminalPrivate::seq_cursor_next_line(vte::parser::Params const& params)
-{
-        set_cursor_column(0);
-        seq_cursor_down(params);
-}
-
 /* Move the cursor to the beginning of the Nth previous line, no scrolling. */
 void
 VteTerminalPrivate::seq_cursor_preceding_line(vte::parser::Params const& params)
@@ -1289,14 +1281,6 @@ VteTerminalPrivate::seq_delete_characters(vte::parser::Params const& params)
                 delete_character();
 }
 
-/* Cursor down N lines, no scrolling. */
-void
-VteTerminalPrivate::seq_cursor_down(vte::parser::Params const& params)
-{
-        auto val = params.number_or_default_at(0, 1);
-        move_cursor_down(val);
-}
-
 void
 VteTerminalPrivate::move_cursor_down(vte::grid::row_t rows)
 {
@@ -2888,6 +2872,8 @@ VteTerminalPrivate::CNL(vte::parser::Sequence const& seq)
          *
          * Defaults:
          *   args[0]: 1
+         *
+         * References: ECMA-48 §8.3.12
          */
 #if 0
         unsigned int num = 1;
@@ -2899,7 +2885,10 @@ VteTerminalPrivate::CNL(vte::parser::Sequence const& seq)
         screen_cursor_down(screen, num, false);
 #endif
 
-        seq_cursor_next_line(seq);
+        set_cursor_column1(1);
+
+        auto value = seq.collect1(0, 1);
+        move_cursor_down(value);
 }
 
 void
@@ -2977,6 +2966,8 @@ VteTerminalPrivate::CUD(vte::parser::Sequence const& seq)
          *
          * Defaults:
          *   args[0]: 1
+         *
+         * References: ECMA-48 § 8.3.19
          */
 #if 0
         unsigned int num = 1;
@@ -2988,7 +2979,8 @@ VteTerminalPrivate::CUD(vte::parser::Sequence const& seq)
         screen_cursor_down(screen, num, false);
 #endif
 
-        seq_cursor_down(seq);
+        auto value = seq.collect1(0, 1);
+        move_cursor_down(value);
 }
 
 void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]