mixing wrap-modes in text view


is this possible?
I would like to protect certain terms (consisting of multiple words)
against word wrap in a gtk text view.
I thought this might be possible by creating a 'nowrap' tag an a 'wrap'
tag and insert the protected terms with nowrap and the rest of the
text with the wrap tag. The nowrap sections should then be treated as
one word.

Unfortunately this does not work as expected. What I see is that
the text view uses the wrap mode of the first text in a line for the
whole line, even if text with other wrap modes is following.
So if a line starts with text with the nowrap tag, the line isn't wrapped,
if the line starts with text tagged with 'wrap', even text tagged with nowrap
is wrapped.

Is this intentional?
Further: I'd like to enable wrapping between two texts in nowrap mode.
Should that be supported? I thought about adding a unicode zero width
nonjoiner (x200C) in wrap mode...

I added a test program (sorry, C++ based on gtkmm) and a screenshot
(I hope an attachment is ok for the mailing list) of what I get.

I'm using gtk+ 2.2.1, pango 1.2.1, gtkmm 2.2.1 and pangomm 2.2.1
with gcc 3.2 on linux.


PS: I would like to add that besides these difficulties text view is a
great and impressing tool. Thanks to everyone who worked at it.

GIF image

Attachment: textview.cc
Description: Binary data

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]