commit d2e2bebcbe7fa3d2d6f9ee84f479d6d0241da8ca from: Omar Polo date: Tue Jan 23 20:41:04 2024 UTC bp_select: call exit_minibuffer() when done Currently it is still fine to access ministate after exit_minibuffer(). In the future, if we ever support recursive minibuffers it won't. So, defer the exit_minibuffer() call and use minibuffer_compl_text() instead of peeking into ministate. While here, also add the "Bookmarked" message when it successfully bookmarked the page. commit - ba8a119df2b3646ede6415168bd7f56bde6d090a commit + d2e2bebcbe7fa3d2d6f9ee84f479d6d0241da8ca blob - fd9485409bc4920186b7be47fcd74adf5b49d0c7 blob + e9606e181d1cb50517cabfd4d25d55fc9d872828 --- minibuffer.c +++ minibuffer.c @@ -333,13 +333,18 @@ lu_select(void) void bp_select(void) { - exit_minibuffer(); - if (*ministate.buf != '\0') { - if (bookmark_page(ministate.buf) == -1) + const char *url; + + url = minibuffer_compl_text(); + if (*url != '\0') { + if (bookmark_page(url) == -1) message("failed to bookmark page: %s", strerror(errno)); + else + message("Bookmarked"); } else message("Abort."); + exit_minibuffer(); } void