diff --git a/gtksourceview/gtksourcebuffer.c b/gtksourceview/gtksourcebuffer.c
index f18871a..c0b3ea4 100644
--- a/gtksourceview/gtksourcebuffer.c
+++ b/gtksourceview/gtksourcebuffer.c
@@ -88,7 +88,8 @@ struct _GtkSourceBufferPrivate
 	gint                   constructed:1;
 
 	GtkTextTag            *bracket_match_tag;
-	GtkTextMark           *bracket_mark;
+	GtkTextMark           *bracket_mark_cursor;
+	GtkTextMark           *bracket_mark_match;
 	guint                  bracket_found:1;
 
 	GArray                *source_marks;
@@ -300,7 +301,8 @@ gtk_source_buffer_init (GtkSourceBuffer *buffer)
 
 	priv->highlight_syntax = TRUE;
 	priv->highlight_brackets = TRUE;
-	priv->bracket_mark = NULL;
+	priv->bracket_mark_cursor = NULL;
+	priv->bracket_mark_match = NULL;
 	priv->bracket_found = FALSE;
 
 	priv->source_marks = g_array_new (FALSE, FALSE, sizeof (GtkSourceMark *));
@@ -578,12 +580,64 @@ get_bracket_match_tag (GtkSourceBuffer *buffer)
 	return buffer->priv->bracket_match_tag;
 }
 
+static gunichar
+bracket_pair (gunichar base_char, gint *direction)
+{
+	gint dir;
+	gunichar pair;
+	switch ((int)base_char) {
+		case '{':
+			dir = 1;
+			pair = '}';
+			break;
+		case '(':
+			dir = 1;
+			pair = ')';
+			break;
+		case '[':
+			dir = 1;
+			pair = ']';
+			break;
+		case '<':
+			dir = 1;
+			pair = '>';
+			break;
+		case '}':
+			dir = -1;
+			pair = '{';
+			break;
+		case ')':
+			dir = -1;
+			pair = '(';
+			break;
+		case ']':
+			dir = -1;
+			pair = '[';
+			break;
+		case '>':
+			dir = -1;
+			pair = '<';
+			break;
+		default:
+			dir = 0;
+			pair = 0;
+			break;
+	}
+
+	/* Let direction be NULL if we don't care */
+	if (direction != NULL) {
+		*direction = dir;
+	}
+	return pair;
+}
+
 static void
 gtk_source_buffer_move_cursor (GtkTextBuffer     *buffer,
 			       const GtkTextIter *iter,
 			       GtkTextMark       *mark)
 {
 	GtkTextIter iter1, iter2;
+	gunichar cursor_char;
 
 	g_return_if_fail (GTK_IS_SOURCE_BUFFER (buffer));
 	g_return_if_fail (iter != NULL);
@@ -597,7 +651,17 @@ gtk_source_buffer_move_cursor (GtkTextBuffer     *buffer,
 	{
 		gtk_text_buffer_get_iter_at_mark (buffer,
 						  &iter1,
-						  GTK_SOURCE_BUFFER (buffer)->priv->bracket_mark);
+						  GTK_SOURCE_BUFFER (buffer)->priv->bracket_mark_match);
+		iter2 = iter1;
+		gtk_text_iter_forward_char (&iter2);
+		gtk_text_buffer_remove_tag (buffer,
+					    GTK_SOURCE_BUFFER (buffer)->priv->bracket_match_tag,
+					    &iter1,
+					    &iter2);
+		
+		gtk_text_buffer_get_iter_at_mark (buffer,
+						  &iter1,
+						  GTK_SOURCE_BUFFER (buffer)->priv->bracket_mark_cursor);
 		iter2 = iter1;
 		gtk_text_iter_forward_char (&iter2);
 		gtk_text_buffer_remove_tag (buffer,
@@ -612,15 +676,16 @@ gtk_source_buffer_move_cursor (GtkTextBuffer     *buffer,
 	iter1 = *iter;
 	if (gtk_source_buffer_find_bracket_match_with_limit (&iter1, MAX_CHARS_BEFORE_FINDING_A_MATCH))
 	{
-		if (!GTK_SOURCE_BUFFER (buffer)->priv->bracket_mark)
-			GTK_SOURCE_BUFFER (buffer)->priv->bracket_mark =
+		// Mark matching bracket
+		if (!GTK_SOURCE_BUFFER (buffer)->priv->bracket_mark_match)
+			GTK_SOURCE_BUFFER (buffer)->priv->bracket_mark_match =
 				gtk_text_buffer_create_mark (buffer,
 							     NULL,
 							     &iter1,
 							     FALSE);
 		else
 			gtk_text_buffer_move_mark (buffer,
-						   GTK_SOURCE_BUFFER (buffer)->priv->bracket_mark,
+						   GTK_SOURCE_BUFFER (buffer)->priv->bracket_mark_match,
 						   &iter1);
 
 		iter2 = iter1;
@@ -629,6 +694,33 @@ gtk_source_buffer_move_cursor (GtkTextBuffer     *buffer,
 					   get_bracket_match_tag (GTK_SOURCE_BUFFER (buffer)),
 					   &iter1,
 					   &iter2);
+
+		// Mark the bracket near the cursor
+		iter1 = *iter;
+		cursor_char = gtk_text_iter_get_char(&iter1);
+		if (bracket_pair(cursor_char, NULL) == 0)
+			gtk_text_iter_backward_char(&iter1);
+		
+		if (!GTK_SOURCE_BUFFER (buffer)->priv->bracket_mark_cursor)
+			GTK_SOURCE_BUFFER (buffer)->priv->bracket_mark_cursor =
+				gtk_text_buffer_create_mark (buffer,
+							     NULL,
+							     &iter1,
+							     FALSE);
+		else
+			gtk_text_buffer_move_mark (buffer,
+						   GTK_SOURCE_BUFFER (buffer)->priv->bracket_mark_cursor,
+						   &iter1);
+
+
+		iter2 = iter1;
+		gtk_text_iter_forward_char (&iter2);
+		gtk_text_buffer_apply_tag (buffer,
+					   get_bracket_match_tag (GTK_SOURCE_BUFFER (buffer)),
+					   &iter1,
+					   &iter2);
+
+
 		GTK_SOURCE_BUFFER (buffer)->priv->bracket_found = TRUE;
 	}
 	else
@@ -821,43 +913,7 @@ gtk_source_buffer_find_bracket_match_real (GtkTextIter *orig, gint max_chars)
 	base_char = search_char = cur_char;
 	base_tag = iter_has_syntax_tag (&iter);
 
-	switch ((int) base_char) {
-		case '{':
-			addition = 1;
-			search_char = '}';
-			break;
-		case '(':
-			addition = 1;
-			search_char = ')';
-			break;
-		case '[':
-			addition = 1;
-			search_char = ']';
-			break;
-		case '<':
-			addition = 1;
-			search_char = '>';
-			break;
-		case '}':
-			addition = -1;
-			search_char = '{';
-			break;
-		case ')':
-			addition = -1;
-			search_char = '(';
-			break;
-		case ']':
-			addition = -1;
-			search_char = '[';
-			break;
-		case '>':
-			addition = -1;
-			search_char = '<';
-			break;
-		default:
-			addition = 0;
-			break;
-	}
+	search_char = bracket_pair(base_char, &addition);
 
 	if (addition == 0)
 		return FALSE;
