diff options
author | Christian Persch <chpe@src.gnome.org> | 2021-04-03 16:07:50 +0200 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2021-04-03 16:07:50 +0200 |
commit | f728689e89ef4f6b83527c9a0d340ee52b7d0cf0 (patch) | |
tree | 52b2ce92a25d0d0850cf0016de46eebd907d60f1 | |
parent | 260416dfc4a93b8e202e09acfcc30e2063d7f37e (diff) | |
download | vte-f728689e89ef4f6b83527c9a0d340ee52b7d0cf0.tar.gz |
sixel: Reset repeat counter when receiving the next command
This was already done when receiving one of the known commands; do the
same when receiving an unimplemented command.
-rw-r--r-- | src/sixel-context.hh | 13 | ||||
-rw-r--r-- | src/sixel-parser.hh | 9 |
2 files changed, 10 insertions, 12 deletions
diff --git a/src/sixel-context.hh b/src/sixel-context.hh index b3adea86..60114991 100644 --- a/src/sixel-context.hh +++ b/src/sixel-context.hh @@ -543,13 +543,6 @@ private: m_repeat_count = seq.param(0, 1); } - /* FIXMEchpe: should also set - * - * m_repeat_count = 1; - * - * for all the unused RESERVED_* sixel commands. - */ - void SIXEL(uint8_t sixel) noexcept { @@ -597,6 +590,12 @@ private: } void + SIXEL_NOP(vte::sixel::Sequence const& seq) noexcept + { + m_repeat_count = 1; + } + + void SIXEL_ST(char32_t st) noexcept { m_st = st; diff --git a/src/sixel-parser.hh b/src/sixel-parser.hh index 821acdc9..850928da 100644 --- a/src/sixel-parser.hh +++ b/src/sixel-parser.hh @@ -61,7 +61,7 @@ protected: unsigned m_command{(unsigned)Command::NONE}; unsigned m_n_args{0}; - vte_seq_arg_t m_args[VTE_SIXEL_PARSER_ARG_MAX]{0, 0, 0, 0, 0, 0 ,0 ,0}; + vte_seq_arg_t m_args[VTE_SIXEL_PARSER_ARG_MAX]{0, 0, 0, 0, 0, 0 ,0, 0}; constexpr auto capacity() const noexcept { @@ -330,7 +330,7 @@ private: case Command::DECGCI: return delegate.DECGCI(m_seq); case Command::DECGCR: return delegate.DECGCR(m_seq); case Command::DECGNL: return delegate.DECGNL(m_seq); - case Command::NONE: + case Command::NONE: return; case Command::RESERVED_2_05: case Command::RESERVED_2_06: case Command::RESERVED_2_07: @@ -343,9 +343,8 @@ private: case Command::RESERVED_2_15: case Command::RESERVED_3_12: case Command::RESERVED_3_13: - case Command::RESERVED_3_14: - default: - return; + case Command::RESERVED_3_14: return delegate.SIXEL_NOP(m_seq); + default: __builtin_unreachable(); return; } } |