diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2023-04-13 12:06:06 +0300 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2023-04-13 12:06:06 +0300 |
commit | a105a8a0875224ecf8fa9ec0f337d1a4f30de76c (patch) | |
tree | 6223cd11094a102305013444fe4e55f17b980c98 /src/cmdline.h | |
parent | 9395b90c2bd441285651464818d69781682dd298 (diff) | |
download | sciteco-a105a8a0875224ecf8fa9ec0f337d1a4f30de76c.tar.gz |
cmdline.c: simplified the rubin-case
* We no longer need special NULL-values for teco_cmdline_insert(),
as teco_cmdline_rubin() will simply take a character from the rubbed-out
command line and is equivalent to typing a character from the rubbed-out
command-line.
Diffstat (limited to 'src/cmdline.h')
-rw-r--r-- | src/cmdline.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cmdline.h b/src/cmdline.h index b0be0de..85e657a 100644 --- a/src/cmdline.h +++ b/src/cmdline.h @@ -65,7 +65,8 @@ gboolean teco_cmdline_insert(const gchar *data, gsize len, GError **error); static inline gboolean teco_cmdline_rubin(GError **error) { - return teco_cmdline_insert(NULL, 0, error); + return teco_cmdline.effective_len >= teco_cmdline.str.len || + teco_cmdline_insert(teco_cmdline.str.data + teco_cmdline.effective_len, 1, error); } gboolean teco_cmdline_keypress_c(gchar key, GError **error); |