diff options
author | 2018-07-11 12:21:37 +0000 | |
---|---|---|
committer | 2018-07-11 12:21:37 +0000 | |
commit | 5b6ba03a9429768e9d788597969ec8a50a7b9817 (patch) | |
tree | c11455c939aa320566fdd60cae5aeacbcf26687e | |
parent | Change the control socket to ospfd.sock.<rdomain>. (diff) | |
download | wireguard-openbsd-5b6ba03a9429768e9d788597969ec8a50a7b9817.tar.xz wireguard-openbsd-5b6ba03a9429768e9d788597969ec8a50a7b9817.zip |
When in incremental search handle ^M (a.k.a. <cr>) like ^[ (a.k.a.
<esc>). i.e. exit incremental search and set the mark. This is what
emacs does.
pointers, suggestions and ok florian@
-rw-r--r-- | usr.bin/mg/search.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/mg/search.c b/usr.bin/mg/search.c index 2339688699e..fa12b4094aa 100644 --- a/usr.bin/mg/search.c +++ b/usr.bin/mg/search.c @@ -1,4 +1,4 @@ -/* $OpenBSD: search.c,v 1.46 2017/08/06 04:39:45 bcallah Exp $ */ +/* $OpenBSD: search.c,v 1.47 2018/07/11 12:21:37 krw Exp $ */ /* This file is in the public domain. */ @@ -159,10 +159,11 @@ backisearch(int f, int n) /* * Incremental Search. * dir is used as the initial direction to search. + * ^M exit from Isearch, set mark * ^S switch direction to forward * ^R switch direction to reverse * ^Q quote next character (allows searching for ^N etc.) - * <ESC> exit from Isearch + * <ESC> exit from Isearch, set mark * <DEL> undoes last character typed. (tricky job to do this correctly). * other ^ exit search, don't set mark * else accumulate into search string @@ -213,6 +214,8 @@ isearch(int dir) */ if (ttwait(300) == FALSE) ungetkey(c); + /* FALLTHRU */ + case CCHR('M'): srch_lastdir = dir; curwp->w_markp = clp; curwp->w_marko = cbo; @@ -360,9 +363,6 @@ isearch(int dir) case CCHR('Q'): c = (char)getkey(FALSE); goto addchar; - case CCHR('M'): - c = CCHR('J'); - goto addchar; default: if (ISCTRL(c)) { ungetkey(c); |