<p>This PR is about adding features to make it possible to sort the tabs in the editor area.  It includes the following changes:</p>

<p><a href="https://github.com/geany/geany/commit/04eb16b326fcbf291c3bf71118ead2d5b9edc1b7" class="commit-link"><tt>04eb16b</tt></a> Add capability to automatically sort editor tabs<br>
<a href="https://github.com/geany/geany/commit/138dd095b9f1eb166d41ae3f8b1956589a3308f4" class="commit-link"><tt>138dd09</tt></a> Add keybindings for sorting editor tabs<br>
<a href="https://github.com/geany/geany/commit/803d6a6364d52d1b38b565f3421d4ec3e484500d" class="commit-link"><tt>803d6a6</tt></a> Add capability to sort editor tabs<br>
<a href="https://github.com/geany/geany/commit/a64749e9b99188e179e7f1a5680307da9d873cc6" class="commit-link"><tt>a64749e</tt></a> Allow document_get_notebook_child() to be used globally</p>

<p>I chose to place them in one PR so everything can be discussed in one place.   Each update depends on the other update that comes earlier than it.  Which means, if the last update is wanted (<code>04eb16b</code>), all other updates that came before it should be included, but if only <code>803d6a6</code> is wanted, it would only require <code>a64749e</code>.</p>

<p>Here are the snapshots:</p>

<p><a href="http://imgur.com/6uYVd72">http://imgur.com/6uYVd72</a><br>
<a href="http://imgur.com/G4Fi9iV">http://imgur.com/G4Fi9iV</a><br>
<a href="http://imgur.com/VNOJaVv">http://imgur.com/VNOJaVv</a><br>
<a href="http://imgur.com/Pb00zIK">http://imgur.com/Pb00zIK</a></p>

<p>The first 2 updates (<code>803d6a6</code> and <code>138dd09</code>) made a fair amount of changes in the code, but the last update had to be a little aggressive since the only way to get it done properly is to alter the codes that call <code>document_open_file()</code>.  Modifying <code>document_open_file()</code> itself would mean that every file opened would cause the order of tabs in the notebook widget to be recalculated and rearranged.</p>

<p>This could cause significant slowdown during startup time especially when opening a lot of files.  That's why the only proper way to do it is to make changes on the calling functions instead, where we could only allow a function like <code>notebook_auto_sort_tabs()</code> to be called once after multiple files are opened.</p>

<p>We can also create a wrapper function like <code>document_open_file_and_auto_sort_tabs()</code> but it would only apply to calling functions that only open a file once everytime they are called.</p>

<p>It's unlikely for the last update to be merged because of that, but please also consider the first two (<code>803d6a6</code> and <code>138dd09</code>).  I can create another PR for those if wanted.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/geany/geany/pull/1144'>https://github.com/geany/geany/pull/1144</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Allow document_get_notebook_child() to be used globally</li>
  <li>Add capability to sort editor tabs</li>
  <li>Add keybindings for sorting editor tabs</li>
  <li>Add capability to automatically sort editor tabs</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/1144/files#diff-0">data/geany.glade</a>
    (30)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/1144/files#diff-1">src/callbacks.c</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/1144/files#diff-2">src/document.c</a>
    (16)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/1144/files#diff-3">src/document.h</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/1144/files#diff-4">src/keybindings.c</a>
    (22)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/1144/files#diff-5">src/keybindings.h</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/1144/files#diff-6">src/keyfile.c</a>
    (15)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/1144/files#diff-7">src/libmain.c</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/1144/files#diff-8">src/msgwindow.c</a>
    (6)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/1144/files#diff-9">src/notebook.c</a>
    (110)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/1144/files#diff-10">src/notebook.h</a>
    (14)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/1144/files#diff-11">src/osx.c</a>
    (3)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/1144/files#diff-12">src/prefs.c</a>
    (40)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/1144/files#diff-13">src/symbols.c</a>
    (8)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/1144/files#diff-14">src/ui_utils.c</a>
    (7)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/1144/files#diff-15">src/ui_utils.h</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/1144/files#diff-16">src/win32.c</a>
    (10)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/geany/geany/pull/1144.patch'>https://github.com/geany/geany/pull/1144.patch</a></li>
  <li><a href='https://github.com/geany/geany/pull/1144.diff'>https://github.com/geany/geany/pull/1144.diff</a></li>
</ul>

<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">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJ5qvnMKbv9t0pwm45MEPRIlrkJUTks5qXiBggaJpZM4JQxCD">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJ44gqDDpz4KeeqOnN-3fefus7IpMks5qXiBggaJpZM4JQxCD.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"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>