GNOME Bugzilla – Bug 316550
Tagging of text inserted at text boundaries
Last modified: 2018-02-10 03:24:34 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:
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.
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.