summaryrefslogtreecommitdiff
path: root/nncmpp.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2017-06-26 04:19:42 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2017-06-26 04:19:42 +0200
commit7d414c76470c55b9b517e7a990fa23121da645ad (patch)
treec6631aa9d9af6fc51c758818e7f7a316a1151a2c /nncmpp.c
parent33f5ba0b60a0d60bd63e3bde1e07fc2a2ffc456a (diff)
downloadnncmpp-7d414c76470c55b9b517e7a990fa23121da645ad.tar.gz
nncmpp-7d414c76470c55b9b517e7a990fa23121da645ad.tar.xz
nncmpp-7d414c76470c55b9b517e7a990fa23121da645ad.zip
Make left/right skip non-spacing characters
Diffstat (limited to 'nncmpp.c')
-rw-r--r--nncmpp.c8
1 files 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:
{