Commit e05dfda2 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

help: don't cycle forward in the buffers when exiting from help

When nano has multiple files open, closing a help buffer should
not switch to the next buffer in the ring but to the preceding one,
because it was from there that the help screen was invoked.
parent fe012dad
No related merge requests found
Showing with 4 additions and 1 deletion
+4 -1
......@@ -611,7 +611,7 @@ void switch_to_prevnext_buffer(bool to_next)
assert(openfile != NULL);
/* If only one file buffer is open, say so and get out. */
if (openfile == openfile->next) {
if (openfile == openfile->next && !inhelp) {
statusbar(_("No more open file buffers"));
return;
}
......
......@@ -235,6 +235,9 @@ void do_help(void)
}
}
/* Switch back to the buffer we were invoked from. */
switch_to_prev_buffer_void();
/* Restore the settings of all flags. */
memcpy(flags, stash, sizeof(flags));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment