From 52a8d7ff2b7454865b486c0f972395b6ccffd31a Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Tue, 16 Feb 2016 03:34:55 +0100 Subject: fixed function key macros and command reinsertion after ^[ * one would expect function key macros masked for the start state to work after ^[ ($), but since it has its own state now, this was broken since f08187e454f56954b41d95615ca2e370ba19667e. * Similarily command reinsertion would reinsert too much after $, since the parser wouldn't be in the "real" start state. * The "escape" state should be handled like the start state (where new commands can begin) from the perspective of the user -- the difference is not even documented, it's an implementation detail. --- src/parser.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/parser.h') diff --git a/src/parser.h b/src/parser.h index b502f46..b18e13c 100644 --- a/src/parser.h +++ b/src/parser.h @@ -332,6 +332,17 @@ namespace States { extern State *current; + static inline bool + is_start() + { + /* + * The "escape" state exists only as a hack, + * to support $$. Otherwise it should behave + * like the start state. + */ + return current == &start || current == &escape; + } + static inline bool is_string() { -- cgit v1.2.3