diff options
author | portix <portix@gmx.net> | 2014-03-22 13:39:49 +0100 |
---|---|---|
committer | portix <portix@gmx.net> | 2014-03-22 13:39:49 +0100 |
commit | 937da7ef873ecebb944fdde6fed64f34c753fbbc (patch) | |
tree | 57111c99585611db6845a9c5838e2900debccf67 | |
parent | ef4e38c04341f9f1ec6c287fd07f9be4ae8728ae (diff) | |
download | dwb-937da7ef873ecebb944fdde6fed64f34c753fbbc.zip |
Respect numbers in visual mode
-rw-r--r-- | src/visual.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/visual.c b/src/visual.c index 1d127e5f..fc101a6b 100644 --- a/src/visual.c +++ b/src/visual.c @@ -49,6 +49,10 @@ visual_caret(GdkEventKey *e) guint keyval[3] = { 0, 0, 0 }; guint state[3] = { defaultMask, defaultMask, defaultMask }; + if (DIGIT(e) && (e->keyval != GDK_KEY_0 || dwb.state.nummod != -1)) { + dwb_set_nummod(e); + return true; + } switch (e->keyval) { @@ -77,6 +81,7 @@ visual_caret(GdkEventKey *e) keyval[0] = GDK_KEY_Right; state[0] = GDK_CONTROL_MASK | defaultMask; break; + case GDK_KEY_asciicircum: case GDK_KEY_0: keyval[0] = GDK_KEY_Home; break; @@ -120,6 +125,9 @@ visual_caret(GdkEventKey *e) break; default :return false; } - dispatch_event(keyval, state); + for (int i=0; i<NUMMOD; i++) { + dispatch_event(keyval, state); + } + dwb.state.nummod = -1; return true; } |