Return a non-printing sequence for no context separators

Function symbols_get_context_separator() returns the symbol
separator for the language, but some languages do not have
symbol context separators, for example markup languages like
Asciidoc.  To prevent the symbols pane wrongly detecting and
acting on a valid character sequence as a separator, return a
non-printing character which should not occur.

Options "" and NULL not used as they break some code and would
need an ABI bump.

Other languages can be added as they are identified.
This commit is contained in:
elextr 2013-05-15 14:03:08 +10:00
parent 989a1f2ccb
commit c2d2fddca3

View File

@ -286,6 +286,9 @@ GString *symbols_find_tags_as_string(GPtrArray *tags_array, guint tag_types, gin
* @param ft_id File type identifier.
* @return The context separator string.
*
* Returns non-printing sequence "\x03" ie ETX (end of text) for filetypes
* without a context separator.
*
* @since 0.19
*/
const gchar *symbols_get_context_separator(gint ft_id)
@ -303,6 +306,10 @@ const gchar *symbols_get_context_separator(gint ft_id)
case GEANY_FILETYPES_REST:
return ":::";
/* no context separator */
case GEANY_FILETYPES_ASCIIDOC:
return "\x03";
default:
return ".";
}