- /* Move insert AND selection_bound before we redisplay */
- real_set_mark (tree, tree->insert_mark,
- "insert", FALSE, ins, TRUE, FALSE);
- real_set_mark (tree, tree->selection_bound_mark,
- "selection_bound", FALSE, bound, TRUE, FALSE);
+ /* Check if it's no-op since gtk_text_buffer_place_cursor()
+ * also calls this, and this will redraw the cursor line. */
+ if (!gtk_text_iter_equal (&old_ins, ins) ||
+ !gtk_text_iter_equal (&old_bound, bound))
+ {
+ redisplay_region (tree, &old_ins, &old_bound, TRUE);
+
+ /* Move insert AND selection_bound before we redisplay */
+ real_set_mark (tree, tree->insert_mark,
+ "insert", FALSE, ins, TRUE, FALSE);
+ real_set_mark (tree, tree->selection_bound_mark,
+ "selection_bound", FALSE, bound, TRUE, FALSE);