From 0a0d0b7cd9ce2942d5194762478a4e24cd05eca4 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Wed, 8 Mar 2017 12:51:06 +0100 Subject: fixup to 89224899: fixed function key macros after $ and the rubout-command editing key * StateEscape should return the same fnmacro mask as StateStart * When rubbing out a command, we should stop at StateEscape as well. Therefore we reintroduced States::is_start(). RTTI is still not used. --- src/parser.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/parser.h') diff --git a/src/parser.h b/src/parser.h index 700d25f..56e58c4 100644 --- a/src/parser.h +++ b/src/parser.h @@ -300,6 +300,16 @@ private: State *custom(gchar chr); void end_of_macro(void); + + /* + * The state should behave like StateStart + * when it comes to function key macro masking. + */ + fnmacroMask + get_fnmacro_mask(void) const + { + return FNMACRO_MASK_START; + } }; class StateFCommand : public State { @@ -405,6 +415,15 @@ namespace States { extern StateInsertIndent insert_indent; extern State *current; + + static inline bool + is_start(void) + { + /* + * StateEscape should behave very much like StateStart. + */ + return current == &start || current == &escape; + } } extern enum Mode { -- cgit v1.2.3