* always filter-out symbol from the current line from the list * when clicked on a symbol on the current line always swap definition/declaration search even if there are more symbols from the current search direction
Fixes #950 You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/958
-- Commit Summary --
* Improve Goto Symbol popup contents
-- File Changes --
M src/symbols.c (130)
-- Patch Links --
https://github.com/geany/geany/pull/958.patch https://github.com/geany/geany/pull/958.diff
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/958
@b4n I took some ideas from your implementation and kept some bits from my implementation and this is the result. I believe it behaves quite reasonably now.
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/958#issuecomment-195311482
}
- else if (workspace_tags->len > 1)
- else if (tags->len > 1)
Just renamed workspace_tags to tags because "workspace_tags" was a bit misleading now. No real change below this line.
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/958/files#r55814285
Speaking of the popup (which is truly awesome), there's one problem. In my work I often have the same file open (different svn checkouts). The popup has no indication which file will be switched to. Do you think the popup could have the paths to the file as well (at least partly)?
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/958#issuecomment-218666877
@kugel- There's no technical reason why this couldn't be done - the only problem is the path might be too long and one could easily end up with a popup covering one half of the screen.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/958#issuecomment-219035188
Right. My idea was to only show the file name and the first different path component, with everything inbetween hidden with [...] (same for the components leading from / to the first different one)
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/958#issuecomment-219092304
@@ -2071,102 +2071,114 @@ static TMTag *find_best_goto_tag(GeanyDocument *doc, GPtrArray *tags) }
+static GPtrArray *filter_tags(GPtrArray *tags, TMTag *current_tag, gboolean definition) +{
- const TMTagType forward_types = tm_tag_prototype_t | tm_tag_externvar_t;
- TMTag *tmtag, *last_tag = NULL;
- GPtrArray *filtered_tags = g_ptr_array_new();
- guint i;
- foreach_ptr_array(tmtag, i, tags)
- {
if (definition && !(tmtag->type & forward_types) ||
!definition && (tmtag->type & forward_types))
GCC suggests parentheses, and while the indention is fairly clear, I think it's still a good idea.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/958/files/65f84df5cae544deaf3a4ca56c7f29...
One thing (it's the same currently): if there's no definition available, but a declaration, <kbd>Ctrl+LBM</kbd> goes nowhere. It might makes sense if it's bound to "got to definition", but it's impractical (i.e. if you've got the header for a lib but not its implementation, it'd be useful to be able to jump to the declaration).
One practical example (although a fairly bad one): in *geanyobject.c*, <kbd>Ctrl+LBM</kbd> on `document_reload` (from the signal definition) goes nowhere, but in *geanyobject.h* there's a member of that name, and there's also a prototype in *pluginsignals.c*.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/958#issuecomment-224725731
@b4n, does shift+ctrl+t not work?
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/958#issuecomment-224750446
@elextr sure it does. Well, I guess maybe I just would expect <kbd>Ctrl+LMB</kbd> to "do whatever makes sense" (in my opinion), which here is to go to what it can.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/958#issuecomment-224754105
Oh, you want to create a "goto definition else declaration" action?
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/958#issuecomment-224755619
kinda. it's already swapping definition/declaration when the current line holds the other, so it's already somewhat like that, but yeah.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/958#issuecomment-224755830
Ok, sounds useful, probably should have a conventional keybinding (well a possibility of it, doesn't have to have a default binding) rather than just the undiscoverable some-meta-key+click.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/958#issuecomment-224756763
One thing (it's the same currently): if there's no definition available, but a declaration, Ctrl+LBM goes nowhere. It might makes sense if it's bound to "got to definition", but it's impractical (i.e. if you've got the header for a lib but not its implementation, it'd be useful to be able to jump to the declaration).
Makes sense, I've just pushed a fix for that.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/958#issuecomment-224826568
LGTM
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/958#issuecomment-225305811
Merged #958.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/958#event-689161647
@kugel- I created https://github.com/geany/geany/issues/1069 to track the issue you mentioned.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/958#issuecomment-225345692
github-comments@lists.geany.org