Synced with upstream

master
Yevgen Muntyan 2007-02-10 15:22:05 -06:00
parent 4c8f48da37
commit 14f5e8bfae
2 changed files with 13 additions and 29 deletions

View File

@ -70,13 +70,16 @@ exact_prefix_cmp (const gchar *string,
type = g_unichar_type (g_utf8_get_char (string + prefix_len));
/* If string contains prefix, check that prefix is not followed
* by a unicode mark symbol, e.g. that trailing 'a' in prefix
* is not part of two-char a-with-hat symbol in string. */
return type != G_UNICODE_NON_SPACING_MARK &&
type != G_UNICODE_ENCLOSING_MARK &&
type != G_UNICODE_NON_SPACING_MARK;
}
static const gchar *
gtk_source_strcasestr (const gchar *haystack, const gchar *needle)
utf8_strcasestr (const gchar *haystack, const gchar *needle)
{
gsize needle_len;
gsize haystack_len;
@ -131,7 +134,7 @@ finally_1:
}
static const gchar *
gtk_source_strrcasestr (const gchar *haystack, const gchar *needle)
utf8_strrcasestr (const gchar *haystack, const gchar *needle)
{
gsize needle_len;
gsize haystack_len;
@ -186,7 +189,7 @@ finally_1:
}
static gboolean
gtk_source_caselessnmatch (const char *s1, const char *s2,
utf8_caselessnmatch (const char *s1, const char *s2,
gssize n1, gssize n2)
{
gchar *casefold;
@ -323,14 +326,14 @@ lines_match (const GtkTextIter *start,
if (match_start) /* if this is the first line we're matching */
{
found = gtk_source_strcasestr (line_text, *lines);
found = utf8_strcasestr (line_text, *lines);
}
else
{
/* If it's not the first line, we have to match from the
* start of the line.
*/
if (gtk_source_caselessnmatch (line_text, *lines, strlen (line_text),
if (utf8_caselessnmatch (line_text, *lines, strlen (line_text),
strlen (*lines)))
found = line_text;
else
@ -421,14 +424,14 @@ backward_lines_match (const GtkTextIter *start,
if (match_start) /* if this is the first line we're matching */
{
found = gtk_source_strrcasestr (line_text, *lines);
found = utf8_strrcasestr (line_text, *lines);
}
else
{
/* If it's not the first line, we have to match from the
* start of the line.
*/
if (gtk_source_caselessnmatch (line_text, *lines, strlen (line_text),
if (utf8_caselessnmatch (line_text, *lines, strlen (line_text),
strlen (*lines)))
found = line_text;
else

View File

@ -408,25 +408,6 @@ gtk_source_style_manager_prepend_search_path (GtkSourceStyleManager *manager,
g_free (new_dirs);
}
#if 0
gboolean
gtk_source_style_manager_add_scheme (GtkSourceStyleManager *manager,
const gchar *filename)
{
GtkSourceStyleScheme *scheme;
g_return_val_if_fail (GTK_IS_SOURCE_STYLE_MANAGER (manager), FALSE);
g_return_val_if_fail (filename != NULL, FALSE);
scheme = _gtk_source_style_scheme_new_from_file (filename);
if (scheme == NULL)
return FALSE;
/* ??? */
}
#endif
static void
reload_if_needed (GtkSourceStyleManager *mgr)
{