Skip to content

Instantly share code, notes, and snippets.

@0branch
Created December 19, 2019 21:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0branch/bc4a60089253fc6ce860e172f39f0bcb to your computer and use it in GitHub Desktop.
Save 0branch/bc4a60089253fc6ce860e172f39f0bcb to your computer and use it in GitHub Desktop.
diff --git a/basic.c b/basic.c
index 8c687aa..3ca56b8 100644
--- a/basic.c
+++ b/basic.c
@@ -1449,7 +1449,13 @@ makemarkslist(int value GCC_UNUSED, void *dummy GCC_UNUSED)
int
showmarks(int f, int n GCC_UNUSED)
{
- return liststuff(MARKS_BufName, FALSE, makemarkslist, f, (void *) curbp);
+ WINDOW *wp = curwp;
+ int s = liststuff(MARKS_BufName, FALSE, makemarkslist, f, (void *) curbp);
+ /* back to the buffer whose marks we just listed */
+ if (swbuffer(wp->w_bufp)) {
+ curwp = wp;
+ }
+ return s;
}
#if OPT_UPBUFF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment