[vte] emulation: Port SD, SU to new parameter glue
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte] emulation: Port SD, SU to new parameter glue
- Date: Tue, 27 Mar 2018 17:42:53 +0000 (UTC)
commit 87385bb7ba0354e764ed652711f2c073cfaa40a2
Author: Christian Persch <chpe src gnome org>
Date: Tue Mar 27 19:40:12 2018 +0200
emulation: Port SD, SU to new parameter glue
src/vteseq-list.hh | 2 --
src/vteseq.cc | 30 +++++++++---------------------
2 files changed, 9 insertions(+), 23 deletions(-)
---
diff --git a/src/vteseq-list.hh b/src/vteseq-list.hh
index 37b2b2d..6b353e5 100644
--- a/src/vteseq-list.hh
+++ b/src/vteseq-list.hh
@@ -95,8 +95,6 @@ SEQUENCE_HANDLER(reverse_index)
SEQUENCE_HANDLER(save_cursor)
SEQUENCE_HANDLER(save_mode)
SEQUENCE_HANDLER(screen_alignment_test)
-SEQUENCE_HANDLER(scroll_down)
-SEQUENCE_HANDLER(scroll_up)
SEQUENCE_HANDLER(select_character_protection)
SEQUENCE_HANDLER(select_locator_events)
SEQUENCE_HANDLER(selective_erase_in_display)
diff --git a/src/vteseq.cc b/src/vteseq.cc
index ec8c78c..ed73c38 100644
--- a/src/vteseq.cc
+++ b/src/vteseq.cc
@@ -1445,15 +1445,6 @@ VteTerminalPrivate::seq_next_line(vte::parser::Params const& params)
cursor_down(true);
}
-/* Scroll the text down N lines, but don't move the cursor. */
-void
-VteTerminalPrivate::seq_scroll_down(vte::parser::Params const& params)
-{
- /* No ensure_cursor_is_onscreen() here as per xterm */
- auto val = std::max(params.number_or_default_at(0, 1), int(1));
- scroll_text(val);
-}
-
/* Internal helper for changing color in the palette */
void
VteTerminalPrivate::change_color(vte::parser::Params const& params,
@@ -1538,16 +1529,6 @@ VteTerminalPrivate::seq_reset_color(vte::parser::Params const& params)
}
}
-/* Scroll the text up N lines, but don't move the cursor. */
-void
-VteTerminalPrivate::seq_scroll_up(vte::parser::Params const& params)
-{
- /* No ensure_cursor_is_onscreen() here as per xterm */
-
- auto val = std::max(params.number_or_default_at(0, 1), int(1));
- scroll_text(-val);
-}
-
/* Cursor down 1 line, with scrolling. */
void
VteTerminalPrivate::seq_line_feed(vte::parser::Params const& params)
@@ -5167,6 +5148,8 @@ VteTerminalPrivate::SD(vte::parser::Sequence const& seq)
*
* Defaults:
* args[0]: 1
+ *
+ * References: ECMA-48 § 8.3.113
*/
#if 0
unsigned int num = 1;
@@ -5181,7 +5164,9 @@ VteTerminalPrivate::SD(vte::parser::Sequence const& seq)
NULL);
#endif
- seq_scroll_down(seq);
+ /* Scroll the text down N lines, but don't move the cursor. */
+ auto value = std::max(seq.collect1(0, 1), int(1));
+ scroll_text(value);
}
void
@@ -5434,6 +5419,8 @@ VteTerminalPrivate::SU(vte::parser::Sequence const& seq)
*
* Defaults:
* args[0]: 1
+ *
+ * References: EMCA-48 § 8.3.147
*/
#if 0
unsigned int num = 1;
@@ -5448,7 +5435,8 @@ VteTerminalPrivate::SU(vte::parser::Sequence const& seq)
screen->history);
#endif
- seq_scroll_up(seq);
+ auto value = std::max(seq.collect1(0, 1), int(1));
+ scroll_text(-value);
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]