aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/cmdline.cpp4
-rw-r--r--src/parser.h19
2 files changed, 21 insertions, 2 deletions
diff --git a/src/cmdline.cpp b/src/cmdline.cpp
index 55d63d7..7a1e6cf 100644
--- a/src/cmdline.cpp
+++ b/src/cmdline.cpp
@@ -586,12 +586,12 @@ State::process_edit_cmd(gchar key)
/* reinsert command */
do
cmdline.insert();
- while (States::current != &States::start && cmdline.rubout_len);
+ while (!States::is_start() && cmdline.rubout_len);
} else {
/* rubout command */
do
cmdline.rubout();
- while (States::current != &States::start);
+ while (!States::is_start());
}
return;
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 {