commit fde6058ed90f00e05ff3b3a16648eadeba8ab18a
parent 28eb9cd79e3941f7e83c3f88261790a9b8207d5f
Author: hhvn <dev@hhvn.uk>
Date: Sat, 18 Jun 2022 14:53:38 +0100
'yy' -> yank current page
Diffstat:
4 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/.config.hhvn.h b/.config.hhvn.h
@@ -33,7 +33,6 @@ enum Bindings {
BIND_ROOT = 'r',
BIND_HELP = 'z',
BIND_HISTORY = 'h',
- BIND_YANK_CURRENT = 'Y',
};
static Scheme scheme[] = {
diff --git a/config.def.h b/config.def.h
@@ -34,7 +34,6 @@ enum Bindings {
BIND_ROOT = 'r',
BIND_HELP = 'h',
BIND_HISTORY = 'H',
- BIND_YANK_CURRENT = 'Y',
};
static Scheme scheme[] = {
diff --git a/zygo.1 b/zygo.1
@@ -13,7 +13,6 @@
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
.Dd COMMIT
.Dt zygo 1
.Os
@@ -136,13 +135,12 @@ Print uri of
where the bar normally is.
.It y Ar Link
Yank URI of
-.Ar link .
-.It Y
-Yank current URI.
+.Ar link
+(typing 'y' again will yank the current page).
.It H
View all links in history.
.El
-.Sh SEE OTHER
+.Sh SEE ALSO
.Xr cgo 1
.Sh AUTHOR
.An hhvn Aq Mt dev@hhvn.uk
diff --git a/zygo.c b/zygo.c
@@ -1021,6 +1021,9 @@ run(void) {
ui.input[--il] = '\0';
syncinput();
}
+ } else if (ui.cmd == BIND_YANK && c == BIND_YANK && !il) {
+ ui.wantinput = 0;
+ yank(current);
} else if (c >= 32 && c < KEY_CODE_YES) {
ui.input[il++] = c;
ui.input[il] = '\0';
@@ -1114,10 +1117,6 @@ run(void) {
error("no history");
}
break;
- case BIND_YANK_CURRENT:
- checkcurrent();
- yank(current);
- break;
/* link numbers */
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':