aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cmdline.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmdline.c')
-rw-r--r--src/cmdline.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/cmdline.c b/src/cmdline.c
index b944b5e..e7761aa 100644
--- a/src/cmdline.c
+++ b/src/cmdline.c
@@ -476,12 +476,10 @@ teco_cmdline_keymacro(const gchar *name, gssize name_len, GError **error)
static void
teco_cmdline_rubout(void)
{
- gsize effective_len = teco_cmdline_ssm(SCI_GETCURRENTPOS, 0, 0);
- gssize p = teco_view_glyphs2bytes_relative(teco_cmdline.view, effective_len, -1);
- if (p >= 0) {
- teco_cmdline_ssm(SCI_GOTOPOS, p, 0);
- teco_undo_pop(p);
- }
+ sptr_t effective_len = teco_cmdline_ssm(SCI_GETCURRENTPOS, 0, 0);
+ sptr_t p = teco_cmdline_ssm(SCI_POSITIONRELATIVE, effective_len, -1);
+ teco_cmdline_ssm(SCI_GOTOPOS, p, 0);
+ teco_undo_pop(p);
}
/**
@@ -1523,12 +1521,17 @@ teco_state_save_cmdline_got_register(teco_machine_main_t *ctx, teco_qreg_t *qreg
return &teco_state_start;
}
-/*$ *q
+/*$ "*q" "E*" "E*q"
* *q -- Save last command line
+ * E*q
*
- * Only at the very beginning of a command-line, this command
- * may be used to save the last command line as a string in
+ * This command may be used to save the last command line as a string in
* Q-Register <q>.
+ * Only at the very beginning of a command line you can also write
+ * \(lq*\(rq without a preceding \(lqE\(rq.
+ */
+/*
+ * FIXME: E*q is allowed but pointless in batch mode.
*/
TECO_DEFINE_STATE_EXPECTQREG(teco_state_save_cmdline,
.expectqreg.type = TECO_QREG_OPTIONAL_INIT,