After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 316550 - Tagging of text inserted at text boundaries
Tagging of text inserted at text boundaries
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkTextView
2.6.x
Other All
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2005-09-17 09:39 UTC by Hans Oesterholt-Dijkema
Modified: 2018-02-10 03:24 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Hans Oesterholt-Dijkema 2005-09-17 09:39:15 UTC
Using gtk+ 2.6.8 on WIN32, I noticed following using
the textview widget and applied tags.

Microsoft Word does following:

When I move the cursor to a point just after applied markup A,
when I type a character it will take the same markup A.
When I use backspace, it takes over the markup of the last
deleted character. So suppose I've got text with markup like

AAAAABBCC

and my cursor is at C, I do a backspace: I will still have
markup C.  Using the delete key does the same in inverse
direction.

gtk text view doesn't work like that. Is this deliberate
behaviour? Word behaviour seems quite intuitive to me.



Other information:
Comment 1 Owen Taylor 2007-10-18 13:29:58 UTC
Experimenting around with OpenOffice writer, the behavior there is quite complex:

 - There is a concept of a "current style", which is independent of anything
   in the buffer. I can hit the Bold button, and type some text, and it will
   be bold.

 - Text inserted is in the current style.

 - Moving the cursor changes the current style to the style of the text before 
   the cursor.

 - Deleting text changes the current style to the style of the text before the
   cursor. *Except*

 - A deletion that removes an entire range of text in one style with different
   styles before and after does not change the current style. This allows
   you to backspace out the last character of a style and then insert it back.

I think an application could implement this type of behavior on top of
GtkTextView, but it's not (in my opinion) suitable for GtkTextView itself, where
the tags are mechanism up to the application.

A simple change to the behavior of what happens when you insert text at a
tag boundary might be feasible, though I think it would need to be an API
addition of some sort, for compatibility reasons.
Comment 2 Matthias Clasen 2018-02-10 03:24:34 UTC
We're moving to gitlab! As part of this move, we are closing bugs that haven't seen activity in more than 5 years. If this issue is still imporant to you and
still relevant with GTK+ 3.22 or master, please consider creating a gitlab issue
for it.