Skip to content

Instantly share code, notes, and snippets.

@codebrainz
Created November 1, 2011 23:40
Show Gist options
  • Select an option

  • Save codebrainz/1332289 to your computer and use it in GitHub Desktop.

Select an option

Save codebrainz/1332289 to your computer and use it in GitHub Desktop.
Remove editor_lexer_get_type_keyword_idx()
diff --git a/HACKING b/HACKING
index a50c179..420eaa8 100644
--- a/HACKING
+++ b/HACKING
@@ -458,9 +458,6 @@ this prevents calltips and autocompletion when typing in a comment
For brace indentation, update lexer_has_braces() in editor.c;
indentation after ':' is done from on_new_line_added().
-If the Scintilla lexer supports user type keyword highlighting (e.g.
-SCLEX_CPP), update editor_lexer_get_type_keyword_idx() in editor.c.
-
Adding a TagManager parser
^^^^^^^^^^^^^^^^^^^^^^^^^^
This assumes the filetype for Geany already exists.
diff --git a/src/document.c b/src/document.c
index eadfa32..0af762c 100644
--- a/src/document.c
+++ b/src/document.c
@@ -2360,15 +2360,12 @@ void document_update_type_keywords(GeanyDocument *doc)
case GEANY_FILETYPES_D:
case GEANY_FILETYPES_JAVA:
case GEANY_FILETYPES_VALA:
+ keyword_idx = 3;
break;
default:
return;
}
- keyword_idx = editor_lexer_get_type_keyword_idx(sci_get_lexer(doc->editor->sci));
- if (keyword_idx == -1)
- return;
-
if (app->tm_workspace == NULL)
return;
diff --git a/src/editor.c b/src/editor.c
index 36c2664..492b477 100644
--- a/src/editor.c
+++ b/src/editor.c
@@ -3486,22 +3486,6 @@ static gboolean editor_lexer_is_c_like(gint lexer)
#endif
-/* Returns: -1 if lexer doesn't support type keywords.
- * @see document_update_type_keywords(). */
-gint editor_lexer_get_type_keyword_idx(gint lexer)
-{
- switch (lexer)
- {
- case SCLEX_CPP:
- case SCLEX_D:
- return 3;
-
- default:
- return -1;
- }
-}
-
-
/* inserts a three-line comment at one line above current cursor position */
void editor_insert_multiline_comment(GeanyEditor *editor)
{
diff --git a/src/editor.h b/src/editor.h
index b9722f7..1a5c2b3 100644
--- a/src/editor.h
+++ b/src/editor.h
@@ -206,8 +206,6 @@ void editor_do_comment(GeanyEditor *editor, gint line, gboolean allow_empty_line
gint editor_do_uncomment(GeanyEditor *editor, gint line, gboolean toggle);
-gint editor_lexer_get_type_keyword_idx(gint lexer);
-
void editor_insert_multiline_comment(GeanyEditor *editor);
void editor_insert_alternative_whitespace(GeanyEditor *editor);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment