<p>I just created another version of this.  This time it has one more sorting method: Sorting by folder (which refers to the folder in the documents list in the sidebar, and does exactly what it has to do: sort documents the way the sidebar sorts them).  I thought this would solve the ambiguity that makes us wonder how 'Sort by pathname' should really sort the documents: whether to copy sidebar's way of sorting them, or whether to just sort them based on their complete pathnames. This time, 'Sort by pathname' does it simpler: get the directory part through <code>doc->realpath</code>.  If <code>realpath</code> is <code>NULL</code>, the directory is simply an empty string.</p>

<p>I placed the the changes in another branch: <a href="https://github.com/konsolebox/geany/tree/sort_tabs_v2">https://github.com/konsolebox/geany/tree/sort_tabs_v2</a></p>

<p>Aside from adding the new feature, these changes were also made:<br>
(List copied from <a href="https://github.com/konsolebox/geany/commit/7adbc1e33f983ec32bfe05006930bcbbb37536a2" class="commit-link">konsolebox@<tt>7adbc1e</tt></a>)</p>

<ul>
<li>Sorting by pathname now relies on doc->realpath when getting the
directory part.</li>
<li>Popup menu now only has a single sort command item (a submenu with three
subitems).</li>
<li>No longer uses NotebookTabAutoSortMethod.  Just added
NOTEBOOK_TAB_SORT_NONE to NotebookTabSortMethod.  Along with
get_compare_method(), it made stuff much simpler.</li>
<li>No longer uses variables 'doc_a' and 'doc_b' since they're only used
once.  '<em>(GeanyDocument *</em>) a|b' is just directly passed as an
argument instead.  It makes the code look less heavier and it saves
a few lines.</li>
<li>Declares GeanyDocument as constant in function declarations.</li>
<li>'on_sort_tabs_by_*_activate' were moved from notebook.h to notebook.c.</li>
<li>Documentation was updated.</li>
</ul>

<p>And these are the preview images: <a href="http://imgur.com/a/PySmh">http://imgur.com/a/PySmh</a></p>

<p>The last image is about the newer update (<a href="https://github.com/konsolebox/geany/commit/474c5ef027d714e9c95c8e0c0b55fdc7da394f40" class="commit-link">konsolebox@<tt>474c5ef</tt></a>) where the radio options are converted to a combobox.</p>

<p>I can forward the changes here if it's wanted.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/pull/1144#issuecomment-236888774">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJ4x69gke8P3ZhqOPKuVzj7CdBiBCks5qbzeigaJpZM4JQxCD">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJ7LgJT50cNpbBxgMEDhYqizMaPA6ks5qbzeigaJpZM4JQxCD.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/geany/geany/pull/1144#issuecomment-236888774"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>