Sample Header Ad - 728x90

Gedit Bracket match is out of range

1 vote
1 answer
147 views
Gedit matches brackets like { with } and tells us where the matching opening/closing bracket is. If it is more than 10000 characters, it says "Bracket match is out of range" instead. How would one go about extending that range? I've got the newest version of Ubuntu and Gedit came with it. Here https://github.com/jaseemabid/gedit I found gedit-master/gedit/gedit-window.c which says in ln.2236-2270
static void
bracket_matched_cb (GtkSourceBuffer           *buffer,
		    GtkTextIter               *iter,
		    GtkSourceBracketMatchType  result,
		    GeditWindow               *window)
{
	if (buffer != GTK_SOURCE_BUFFER (gedit_window_get_active_document (window)))
		return;

	switch (result)
	{
		case GTK_SOURCE_BRACKET_MATCH_NONE:
			gtk_statusbar_pop (GTK_STATUSBAR (window->priv->statusbar),
					   window->priv->bracket_match_message_cid);
			break;
		case GTK_SOURCE_BRACKET_MATCH_OUT_OF_RANGE:
			gedit_statusbar_flash_message (GEDIT_STATUSBAR (window->priv->statusbar),
						       window->priv->bracket_match_message_cid,
						       _("Bracket match is out of range"));
			break;
		case GTK_SOURCE_BRACKET_MATCH_NOT_FOUND:
			gedit_statusbar_flash_message (GEDIT_STATUSBAR (window->priv->statusbar),
						       window->priv->bracket_match_message_cid,
						       _("Bracket match not found"));
			break;
		case GTK_SOURCE_BRACKET_MATCH_FOUND:
			gedit_statusbar_flash_message (GEDIT_STATUSBAR (window->priv->statusbar),
						       window->priv->bracket_match_message_cid,
						       _("Bracket match found on line: %d"),
						       gtk_text_iter_get_line (iter) + 1);
			break;
		default:
			g_assert_not_reached ();
	}
}
So in case the result is GTK_SOURCE_BRACKET_MATCH_OUT_OF_RANGE we get this message. I couldn't figure out where the bracket_matched_cb method is called, this is as far as I got.
Asked by Some Student (13 rep)
Jul 12, 2024, 02:21 PM
Last activity: Jul 17, 2024, 06:38 PM