From 7d414c76470c55b9b517e7a990fa23121da645ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Janouch?= Date: Mon, 26 Jun 2017 04:19:42 +0200 Subject: Make left/right skip non-spacing characters --- nncmpp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nncmpp.c b/nncmpp.c index 735d693..10f9cdc 100644 --- a/nncmpp.c +++ b/nncmpp.c @@ -1685,12 +1685,16 @@ app_editor_process_action (enum action action) case ACTION_EDITOR_B_CHAR: if (g.editor_point < 1) return false; - g.editor_point--; + do g.editor_point--; + while (g.editor_point > 0 + && !g.editor_w[g.editor_point]); return true; case ACTION_EDITOR_F_CHAR: if (g.editor_point + 1 > (int) g.editor_len) return false; - g.editor_point++; + do g.editor_point++; + while (g.editor_point < (int) g.editor_len + && !g.editor_w[g.editor_point]); return true; case ACTION_EDITOR_B_WORD: { -- cgit v1.2.3