The symbols tree view is allowing to navigate through all symbols parsed by CTags. However, when editing a symbol in the editor panel, the highlighted symbol won't synchronize in the tree view. As discussed in issue #1325, an option is to resolve the symbol from the current cursor position.
My implementation of the feature is doing this in two steps: 1. Check if a direct match can be made between the cursor line and one of the TMTag inside the tree 2. If no direct match but in a scope, resolve by selecting this scope
If both steps fail, the selection is cleared.
One thing that I am not sure yet how to implement is the auto-adjustment of the scrollbar to reach the symbol if it's out of visible range. Maybe someone has an idea how to do that in a clean fashion? Should the automatic scroll be an option or default behavior? You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/1348
-- Commit Summary --
* Sync highlighted symbol with cursor position
-- File Changes --
M src/editor.c (9) M src/symbols.c (115) M src/symbols.h (7) M src/ui_utils.c (33) M src/ui_utils.h (2)
-- Patch Links --
https://github.com/geany/geany/pull/1348.patch https://github.com/geany/geany/pull/1348.diff
@frederik-labbe pushed 1 commit.
c872c54 Fix broken indentation
Should the automatic scroll be an option or default behavior?
The default answer for anything UI is "make it an option", no matter how universal you think something is, somebody somewhere will have a valid use-case for wanting the UI to work different. That applies double to things moving by themselves, many people HATE that.
@frederik-labbe pushed 1 commit.
dd4a46a Remove debug stuff
@frederik-labbe pushed 1 commit.
cb9b8cb Tag line all the way to be more flexible with OO languages
@frederik-labbe pushed 1 commit.
2d9d199 Fix indentation
@frederik-labbe pushed 1 commit.
6c6f8aa Fix incoherent comments and prevent edge case scenario when a scope cannot be found in tree view
@frederik-labbe pushed 1 commit.
bca4433 Coding convention
github-comments@lists.geany.org