<p dir="auto">While the current way of grouping symbols under various categories<br>
like "Functions", "Structures", "Macros" etc. may be useful in some<br>
situations, it doesn't allow true sorting by name or sorting by line<br>
number because this sorting is only valid within the group and not<br>
globally which makes it sometimes hard to find some symbol.</p>
<p dir="auto">This patch adds the option to switch between two views of the symbol tree<br>
using the context menu:</p>
<ul dir="auto">
<li>Categorized - the original view used by Geany</li>
<li>Uncategorized - view with a single root element "Symbols" in which<br>
all symbols are rooted and all of them either sorted by line number<br>
or alphabetically</li>
</ul>
<p><a target="_blank" rel="noopener noreferrer" href="https://user-images.githubusercontent.com/713965/163718570-0beb2998-c646-48bd-bc68-f8b749b29942.png"><img width="294" alt="Screen Shot 2022-04-17 at 16 17 38" src="https://user-images.githubusercontent.com/713965/163718570-0beb2998-c646-48bd-bc68-f8b749b29942.png" style="max-width: 100%;"></a></p>
<p><a target="_blank" rel="noopener noreferrer" href="https://user-images.githubusercontent.com/713965/163718574-84ba4857-7674-40a5-a2f6-3d513417d8ae.png"><img width="286" alt="Screen Shot 2022-04-17 at 16 18 33" src="https://user-images.githubusercontent.com/713965/163718574-84ba4857-7674-40a5-a2f6-3d513417d8ae.png" style="max-width: 100%;"></a></p>
<p dir="auto">The core of the implementation is rather simple - there's always the<br>
"Symbols" root present at position 0 in tv_iters and when categorized<br>
view is selected, this root is used for all the tags. (We still need<br>
to keep the category roots in this situation to copy the icons for<br>
the tags from them but they are always empty and hidden).</p>
<p dir="auto">The rest is some UI stuff for creating entries in the context menu, I also<br>
added a config preference so this settings is remembered across Geany<br>
re-launches. I made this option global for all open files because<br>
I would find it annoying to apply this setting manually for every open<br>
file. So the code also checks whether the view type changed for the<br>
given file when switching tabs and re-creates the tree with the new<br>
setting.</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/3172'>https://github.com/geany/geany/pull/3172</a></p>

<h4>Commit Summary</h4>
<ul>
  <li><a href="https://github.com/geany/geany/pull/3172/commits/540c0e694549ee872259f358a9b14855cc71df2d" class="commit-link">540c0e6</a>  Add option to show symbols in symbol tree without root groups</li>
</ul>

<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/geany/geany/pull/3172/files">6 files</a>)</p>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/3172/files#diff-90e39f5f0dfc1344b1b22db34414d3623c2d53cfedcb89e870e24fbb55c93d36">src/document.c</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/3172/files#diff-d736acbeb52cd223cc49af3b5c5087871752e8ad7cb13bc573d6a7687104c82b">src/documentprivate.h</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/3172/files#diff-2810524eed127fdf86cd7a7aaac164efa0d240a2da10844304e79e0307dccaf3">src/keyfile.c</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/3172/files#diff-57618d7b5e160a906f23885f8c59d06d88a517be568cbd428366e24b58c13fe5">src/symbols.c</a>
    (54)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/3172/files#diff-52c3ba1a920ce03ae524e393cf4d0ff582b13d9eafef29393f9841c19adf31f8">src/tagmanager/tm_parser.c</a>
    (26)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/3172/files#diff-c5e507f1f38d770eac7b5a9c906195bdebc43bb064ed4b6af981cdce102f14ff">src/ui_utils.h</a>
    (1)
  </li>
</ul>

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

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/geany/geany/pull/3172">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ3N6LMQG2HJRDTMNYLVFQNVBANCNFSM5TT6KYJA">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAIOWJ6SIWHISP76YA3D56TVFQNVBA5CNFSM5TT6KYJKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4R7IBRIQ.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><geany/geany/pull/3172</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/pull/3172",
"url": "https://github.com/geany/geany/pull/3172",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>