summaryrefslogtreecommitdiff
path: root/gtk/gtktext.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>1998-08-21 00:13:38 +0000
committerOwen Taylor <otaylor@src.gnome.org>1998-08-21 00:13:38 +0000
commit29d8fe021bff60e4cdfbe977fd7dc462a5d3a711 (patch)
tree3b8a03dab531c0e9d18a2997febd74073741958d /gtk/gtktext.c
parentf616dc9a9af64a43d9299c2d2e2a5bb2f9fac6fd (diff)
downloadgtk+-29d8fe021bff60e4cdfbe977fd7dc462a5d3a711.tar.gz
Check to see if we've computed our geometry yet, and if not, ignore the
Thu Aug 20 20:08:15 1998 Owen Taylor <otaylor@redhat.com> * gtk/gtktext.c ([un]draw_cursor): Check to see if we've computed our geometry yet, and if not, ignore the request. gtk/gtktext.c (correct_cache_insert): Fiddled around] some more. All the bug-test codes seem to work at once now. (fingers crossed...)
Diffstat (limited to 'gtk/gtktext.c')
-rw-r--r--gtk/gtktext.c34
1 files changed, 16 insertions, 18 deletions
diff --git a/gtk/gtktext.c b/gtk/gtktext.c
index e963e203f2..2cfed81c59 100644
--- a/gtk/gtktext.c
+++ b/gtk/gtktext.c
@@ -1154,7 +1154,7 @@ gtk_text_realize (GtkWidget *widget)
#endif
init_properties (text);
-
+
gdk_window_show (text->text_area);
if (editable->selection_start_pos != editable->selection_end_pos)
@@ -2484,23 +2484,21 @@ correct_cache_insert (GtkText* text, gint nchars)
/* If we inserted a property exactly at the beginning of the
* line, we have to correct here, or fetch_lines will
* fetch junk.
- *
- * This also handles the case when we split exactly
- * at the beginning and start->offset is now invalid
*/
-
start = &CACHE_DATA(text->current_line).start;
- if (was_split)
- {
- /* If we split exactly at the beginning... */
- if (start->offset == MARK_CURRENT_PROPERTY (start)->length)
- SET_PROPERTY_MARK (start, start->property->next, 0);
- /* If we inserted a property at the beginning of the text... */
- else if ((start->property == text->point.property) &&
- (start->index == text->point.index - nchars))
- SET_PROPERTY_MARK (start, start->property->prev, 0);
- }
-
+
+ /* Check if if we split exactly at the beginning of the line:
+ * (was_split won't be set if we are inserting at the end of the text,
+ * so we don't check)
+ */
+ if (start->offset == MARK_CURRENT_PROPERTY (start)->length)
+ SET_PROPERTY_MARK (start, start->property->next, 0);
+ /* Check if we inserted a property at the beginning of the text: */
+ else if (was_split &&
+ (start->property == text->point.property) &&
+ (start->index == text->point.index - nchars))
+ SET_PROPERTY_MARK (start, start->property->prev, 0);
+
/* Now correct the offsets, and check for start or end marks that
* are after the point, yet point to a property before the point's
* property. This indicates that they are meant to point to the
@@ -4621,7 +4619,7 @@ undraw_cursor (GtkText* text, gint absolute)
if ((text->cursor_drawn_level ++ == 0) &&
(editable->selection_start_pos == editable->selection_end_pos) &&
- GTK_WIDGET_DRAWABLE (text))
+ GTK_WIDGET_DRAWABLE (text) && text->line_start_cache)
{
GdkFont* font;
@@ -4702,7 +4700,7 @@ draw_cursor (GtkText* text, gint absolute)
if ((--text->cursor_drawn_level == 0) &&
editable->editable &&
(editable->selection_start_pos == editable->selection_end_pos) &&
- GTK_WIDGET_DRAWABLE (text))
+ GTK_WIDGET_DRAWABLE (text) && text->line_start_cache)
{
GdkFont* font;