Only autocomplete scope for scopes matching the current filetype's
language. git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3869 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
parent
e1ecc75f44
commit
e386064d5a
@ -3,6 +3,9 @@
|
||||
* src/filetypes.h, src/document.c, src/document.h, src/ui_utils.c:
|
||||
Make GeanyDocument::file_type always be non-NULL, even for a new
|
||||
document with no filetype set.
|
||||
* src/editor.c:
|
||||
Only autocomplete scope for scopes matching the current filetype's
|
||||
language.
|
||||
|
||||
|
||||
2009-06-16 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||
|
@ -490,9 +490,9 @@ static void autocomplete_scope(GeanyEditor *editor)
|
||||
gchar *name;
|
||||
const GPtrArray *tags = NULL;
|
||||
const TMTag *tag;
|
||||
gint ft_id = FILETYPE_ID(editor->document->file_type);
|
||||
GeanyFiletype *ft = editor->document->file_type;
|
||||
|
||||
if (ft_id == GEANY_FILETYPES_C || ft_id == GEANY_FILETYPES_CPP)
|
||||
if (ft->id == GEANY_FILETYPES_C || ft->id == GEANY_FILETYPES_CPP)
|
||||
{
|
||||
if (match_last_chars(sci, pos, "->") || match_last_chars(sci, pos, "::"))
|
||||
pos--;
|
||||
@ -509,7 +509,7 @@ static void autocomplete_scope(GeanyEditor *editor)
|
||||
if (!name)
|
||||
return;
|
||||
|
||||
tags = tm_workspace_find(name, tm_tag_max_t, NULL, FALSE, -1);
|
||||
tags = tm_workspace_find(name, tm_tag_max_t, NULL, FALSE, ft->lang);
|
||||
g_free(name);
|
||||
if (!tags || tags->len == 0)
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user