aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cmdline.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmdline.c')
-rw-r--r--src/cmdline.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/cmdline.c b/src/cmdline.c
index b944b5e..8b2aebd 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);
}
/**