Follow-up to a40823084e1615e04464f974f616794a7b3570da You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/1579
-- Commit Summary --
* Keep the current tab when closing documents to the right of another tab
-- File Changes --
M src/notebook.c (3)
-- Patch Links --
https://github.com/geany/geany/pull/1579.patch https://github.com/geany/geany/pull/1579.diff
What does this accomplish? I'm using this feature for a long time and no problems.
1. Open 3 files 2. Make the far left (1<sup>st</sup>) one current 3. Right click on the middle (2<sup>nd</sup>) tab 4. Choose *Close Documents to the Right*
Expected behavior: * far left document (1<sup>st</sup>) is current (no change)
Actual behavior: * middle document (2<sup>nd</sup>) is current (changed from far left (1<sup>st</sup>) one)
LGBI, I support this change as it implements the expected behaviour
codebrainz commented on this pull request.
gint doc_page = document_get_notebook_page(doc);
for (gint i = doc_page + 1; i < gtk_notebook_get_n_pages(nb); ) { if (! document_close(document_get_from_page(i))) i++; // only increment if tab wasn't closed } - gtk_notebook_set_current_page(nb, doc_page); + gtk_notebook_set_current_page(nb, MIN(current_page, doc_page));
Would've saved me a couple minutes of head-scratching if there was a comment that said "keep the current tab unless it was closed, in which case use the activated tab" or something. Maybe I'm just stupid.
codebrainz approved this pull request.
Seems reasonable to me. I haven't tested yet.
Merged #1579.
github-comments@lists.geany.org