Page 1 of 1

[Solved] Don't break here!

Posted: Sat Apr 26, 2008 4:42 pm
by JDlugosz
I used the word ::?CLASS in a paragraph, and it was placed in a character style to indicate "code". It happened to be near the end of the line, so Writer decided to break the line between the ::? and the CLASS parts.
That is not correct. How do I tell it not to break here?
On a related note, why can't I get my "language:none/no spellchecking" to stick within the character style? When I apply my code style I want to red wavies to go away.

--John

Re: Don't break here!

Posted: Sat Apr 26, 2008 8:38 pm
by TerryE
The process of deciding when to break lines is called Text Flow. To my knowledge, text flow can only be controlled at a paragraph level. There is no mechanism within Writer to override text flow at a character level to keep an arbitrary character string together in a line. Line breaks are automatically inserted as required at word breaks (and within words if hyphenation is enabled, but that's a separate topic). Your problem is that both : and ? are treated as word-break characters.

The easiest way to circumvent this is to insert a line-break (CTL-Enter) before the ::?.

Please follow the forum rules: One post, one topic. Thx

Re: Don't break here!

Posted: Sun Apr 27, 2008 11:28 am
by JDlugosz
Is there any proposal on the books for respecting some kind of non-breaking joiner character, or marking a passage as non-breaking?
Flowing the paragraph manually is only a hack for the final printed version, as it will mess up when the paragraph is edited.

Re: Don't break here!

Posted: Sun Apr 27, 2008 11:49 am
by TerryE
Maybe the other can comment/correct me but I suspect not. The big pressure from users is to match key areas where Writer doesn't do what MS Word does. Here Word suffers from exactly the same limitations. It's only when you get into DTP packages such as LATEX do you start to get this level of control.

Re: Don't break here!

Posted: Sun Apr 27, 2008 12:41 pm
by Robert Tucker
JDlugosz wrote: ... some kind of non-breaking joiner character ...
Zero width no-break space Unicode U+FEFF ?

www.fileformat.info/info/unicode/char/feff/index.htm

Re: Don't break here!

Posted: Sun Apr 27, 2008 1:55 pm
by TerryE
Or perhaps U+2060 — apart from the fact that neither seem to work for Writer or Word. Back to the drawing board :-(

Re: Don't break here!

Posted: Sun Apr 27, 2008 4:18 pm
by Robert Tucker
Both U+FEFF and U+2060 seem to work with Writer on Linux.

video

Re: Don't break here!

Posted: Sun Apr 27, 2008 7:10 pm
by JDlugosz
Ah, 2060 seems to have worked. It shows a thin highlight like a field, so I think it must be "understanding" the intent rather than just being some character with no special knowledge.

Re: [Solved] Don't break here!

Posted: Mon Apr 28, 2008 12:44 am
by acknak
Insert > Formatting Mark > Non-breaking space (Ctrl+Space)

This still seems like a poor workaround. Wouldn't it be better to have a character (span) attribute that says "don't break this"? Or maybe a span that allowed you to control where it could be broken. E.g. a path could be allowed to break, but only at "/"s, or only where it contained an optional break (U+200C ZERO WIDTH NON-JOINER).

Re: [Solved] Don't break here!

Posted: Mon Apr 28, 2008 1:49 am
by TerryE
The problem with non-breaking space is just that — it adds a space. U+2060 is a zero-width non-breaking space. The only problem I found is that I get get it to enter in WinXP, though both Robert and JD got it to work on Linux. As you say acknak, What you would really want is a text style property which disables auto-wrap line break insertion.

Re: [Solved] Don't break here!

Posted: Mon Apr 28, 2008 3:50 pm
by acknak
The problem with non-breaking space is just that — it adds a space.
Oh, duh. No idea what I was thinking there; I just saw "non-breaking" and ran with it.

Thanks for correcting that.