@techee `NULL` check was removed in 292383c197b72c56f44b68b14845093adfed7133, was that really expected? Other solution would be early return in `autocomplete_scope()` when `doc->tm_file` is `NULL`, but that would mean that there wouldn't be scope completion in unsaved files.
We need a fix ASAP, as it happens whenever typing `.` in an unsaved file, or a file with no tags parser. E.g. you can reproduce by opening a new geany `geany -vi` and typing `a.`, *boom*. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/943
-- Commit Summary --
* Avoid NULL dereference when typing a dot in a file without tags
-- File Changes --
M tagmanager/src/tm_workspace.c (2)
-- Patch Links --
https://github.com/geany/geany/pull/943.patch https://github.com/geany/geany/pull/943.diff
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/943
@b4n Ah, I assumed there's always a TMSourceFile available for any GeanyDocument (I assumed there would be a NONE type TMSourceFile for an untitled document). I just wanted to get rid of the -1 which correspons to LANG_AUTO that we shouldn't use. Using TM_PARSER_NONE is perfectly fine and logical in this case so your patch LGTM.
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/943#issuecomment-193300266
No, we only have a TMSourceFile when we actually have a parser setup. We don't even have a TMSourceFile before saving the first time (for now).
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/943#issuecomment-193301410
Merged #943.
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/943#event-580296504
github-comments@lists.geany.org