diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2013-02-11 18:17:51 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2013-02-11 18:17:51 +0100 |
commit | 669bdf6ea9739a26d92e745b71945fea43968dea (patch) | |
tree | 6dbb0516b7d0ca168a9e01cfc86d39f50e2c34e3 /src/cmdline.cpp | |
parent | 891ee79bc292705dd56035a5dca20d8ff6371e50 (diff) | |
download | sciteco-669bdf6ea9739a26d92e745b71945fea43968dea.tar.gz |
States::is_string() to check whether current state is a string-state
Diffstat (limited to 'src/cmdline.cpp')
-rw-r--r-- | src/cmdline.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/cmdline.cpp b/src/cmdline.cpp index a2362bd..2e43e40 100644 --- a/src/cmdline.cpp +++ b/src/cmdline.cpp @@ -107,9 +107,10 @@ cmdline_keypress(gchar key) macro_pc = repl_pos-1; } else { /* - * Undo tokens may have been emitted (or had to be) - * before the exception is thrown. They must be - * executed so as if the character had never been + * Undo tokens may have been emitted + * (or had to be) before the exception + * is thrown. They must be executed so + * as if the character had never been * inserted. */ undo.pop(cmdline_pos); @@ -153,18 +154,18 @@ process_edit_cmd(gchar key) break; case CTL_KEY('W'): - if (dynamic_cast<StateExpectString *>(States::current)) { + if (States::is_string()) { gchar wchars[interface.ssm(SCI_GETWORDCHARS)]; interface.ssm(SCI_GETWORDCHARS, 0, (sptr_t)wchars); /* rubout non-word chars */ do undo.pop(macro_pc--); - while (dynamic_cast<StateExpectString *>(States::current) && + while (States::is_string() && !strchr(wchars, cmdline[macro_pc-1])); /* rubout word chars */ - while (dynamic_cast<StateExpectString *>(States::current) && + while (States::is_string() && strchr(wchars, cmdline[macro_pc-1])) undo.pop(macro_pc--); } else if (cmdline_len) { @@ -177,7 +178,7 @@ process_edit_cmd(gchar key) break; case CTL_KEY('T'): - if (dynamic_cast<StateExpectString *>(States::current)) { + if (States::is_string()) { const gchar *filename = last_occurrence(strings[0]); gchar *new_chars = filename_complete(filename); |