nisus.com
https://www.nisus.com/forum/

classic Keep on Same Line feature
https://www.nisus.com/forum/viewtopic.php?f=17&t=2512
Page 1 of 1

Author:  Brooke6 [ 2007-08-21 15:30:16 ]
Post subject:  classic Keep on Same Line feature

In NWP, I badly miss the old Classic formatting style "Keep on Same Line."

For you macro wizards out there, is it possible to imagine a macro solution/workaround for this missing feature?

Thanks,
Brooke

Author:  Kino [ 2008-09-21 07:06:36 ]
Post subject:  Re: classic Keep on Same Line feature

This one-liner prevents wordwrap by inserting U+2060 (WORD JOINER).
I think it would not be a good thing to use this kind of Unicode characters for such a purpose, which, in my understanding, are intended to be used for formatting plain text. However, if such a functionality is indispensable, then nothing can prevent us. It's a personal computer, after allĀ ;-)
Code:
### Keep on the Same Line ###

# This macro prevents wordwrap by inserting U+2060 (WORD JOINER)
# after "-", "/" and " " (space) WITHIN selected text(s).

# If the actual font does not have U+2060 (n/a in many fonts),
# it will be supplied by another font automatically, possibly
# causing the modification of line spacing. To prevent it, set
# the line spacing to Fixed.

# To remove U+2060, use
#    Replace All '\x{2060}', '', 'E'
# or
#    Replace All '\x{2060}', '', 'Es' # In Selection

Replace All '(?<!\G)(?<=[-/\x20])(?=\p{Any})', '\x{2060}', 'Es'
     # (?<!\G): Not selection start
     # (?=\p{Any}): Not selection end

### end of macro ###

Author:  Hamid [ 2008-09-21 07:34:39 ]
Post subject:  Re: classic Keep on Same Line feature

Thank you! I made this feature request because very often, in Arabic, the last word of the paragraph flows on to the next page even when there is enough space to fit the word on the same line on the previous page. Adding a blank line after the paragraph caused the word to remain on the same line on the previous page.

Author:  Kino [ 2008-09-21 08:00:44 ]
Post subject:  Re: classic Keep on Same Line feature

Hamid wrote:
I made this feature request because very often, in Arabic, the last word of the paragraph flows on to the next page even when there is enough space to fit the word on the same line on the previous page.

Perhaps the macro does not solve that problem, I'm afraid. It seems to me that the culprit is a bug or some negligence in Cocoa text system's calculation of character length when there are diacritical marks.

Author:  Hamid [ 2008-09-21 08:21:45 ]
Post subject:  Re: classic Keep on Same Line feature

The macro does help to refresh and correct the layout. When I run it, it corrects the layout. Then when I undo the action of the macro, the layout stays corrected.

Page 1 of 1 All times are UTC - 8 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/