Add commands for usual text

qwerky
Posts: 172
Joined: 21.10.2013 00:58

Add commands for usual text

Post by qwerky »

CudaText (and SynWrite) is primarily a programmer's editor, and those features are great. There are, of course, some features which are valuable both for programmers and for writers. But the editor would have much broader appeal if, in addition to what is already there, it were given more writer's features. I'm not suggesting it become a full-fledged writer's editor, but that it become more centered, as a general-purpose editor. A good starting point would be some of the following features:

1. Navigation. Functions/Hotkeys to:
a. Goto Beginning of Paragraph
b. Goto End of Paragraph
c. Goto Previous Paragraph
d. Goto Next Paragraph.

2. Formatting/Justification. The ability to format/justify paragraphs in various ways, either live (as editing occurs) or on command. Formatting would include:
a. Indented paragraphs
b. Outdented/hanging paragraphs
c. Non-indented paragraphs
d. Block-indented paragraphs.

Justification would include:
a. Left justified (smooth left edge, ragged right edge)
b. Right justified (ragged left edge, smooth right edge)
c. Center justified (ragged left/right edge)
d. Fully justified (smooth left/right edge)

3. Spell Checking. SynWrite at one time included a live (non-plugin) spell-checker, which I used frequently. It had great performance, and is exactly the type of feature needed in CudaText. (The current spell-check plugin seems not to work, at least for 64-bit version.)

These are just some initial thoughts. If there are other writer-users who read these forums, I'm sure each will have his own ideas as well.
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post by Alexey »

These are wishes for 1) Spell Checker (it needs version for Win x64)
2) CudaExt plugin - many new commands for it.

I wrote to CudaExt author.
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post by Alexey »

Goto begin/end of paragraph: OK

4 types of paragraphs above.
I dont know what it means.
Give examples (in quoted blocks) of all types of paragraphs: hanging, indented...
And tell what a cmd must do to a paragraph.

You want 4 align commands for 4 types of paragraphs?
qwerky
Posts: 172
Joined: 21.10.2013 00:58

Post by qwerky »

Alexey wrote:4 types of paragraphs above.
I dont know what it means.
Give examples (in quoted blocks) of all types of paragraphs: hanging, indented...
Okay.

An indented paragraph, sometimes called first-line indent, often considered a 'normal' paragraph:

Code: Select all

          Lorem ipsum dolor sit amet, consectetur adipiscing elit.  Etiam ultricies sagittis
orci, nec consequat dolor consequat ac.  Nulla eleifend rutrum semper.  Sed fringilla,
ligula eu gravida tempor, quam magna blandit dolor, quis imperdiet sapien erat eu nibh.
Nunc rutrum pulvinar nulla in facilisis.  Quisque feugiat purus in leo condimentum non
congue eros consectetur.  Praesent dictum consequat nulla, bibendum rhoncus enim
adipiscing et.  Pellentesque mi tellus, ornare id mattis ac, sollicitudin a erat.  Maecenas
sit amet vehicula odio.
An outdented, or hanging paragraph (first line hangs over [to the left], rest indented):

Code: Select all

Lorem ipsum dolor sit amet, consectetur adipiscing elit.  Etiam ultricies sagittis orci,
          nec consequat dolor consequat ac.  Nulla eleifend rutrum semper.  Sed fringilla,
          ligula eu gravida tempor, quam magna blandit dolor, quis imperdiet sapien erat eu
          nibh.  Nunc rutrum pulvinar nulla in facilisis.  Quisque feugiat purus in leo
          condimentum non congue eros consectetur.  Praesent dictum consequat nulla,
          bibendum rhoncus enim adipiscing et.  Pellentesque mi tellus, ornare id mattis ac,
          sollicitudin a erat.  Maecenas sit amet vehicula odio.
A non-indented (block) paragraph (no indentation):

Code: Select all

Lorem ipsum dolor sit amet, consectetur adipiscing elit.  Etiam ultricies sagittis orci,
nec consequat dolor consequat ac.  Nulla eleifend rutrum semper.  Sed fringilla, ligula
eu gravida tempor, quam magna blandit dolor, quis imperdiet sapien erat eu nibh.  Nunc
rutrum pulvinar nulla in facilisis.  Quisque feugiat purus in leo condimentum non congue
eros consectetur.  Praesent dictum consequat nulla, bibendum rhoncus enim adipiscing
et.  Pellentesque mi tellus, ornare id mattis ac, sollicitudin a erat.  Maecenas sit amet
vehicula odio.
A block-indented paragraph (entire paragraph indented):

Code: Select all

          Lorem ipsum dolor sit amet, consectetur adipiscing elit.  Etiam ultricies sagittis
          orci, nec consequat dolor consequat ac.  Nulla eleifend rutrum semper.  Sed
          fringilla, ligula eu gravida tempor, quam magna blandit dolor, quis imperdiet sapien
          erat eu nibh.  Nunc rutrum pulvinar nulla in facilisis.  Quisque feugiat purus in leo
          condimentum non congue eros consectetur.  Praesent dictum consequat nulla,
          bibendum rhoncus enim adipiscing et.  Pellentesque mi tellus, ornare id mattis ac,
          sollicitudin a erat.  Maecenas sit amet vehicula odio.
And tell what a cmd must do to a paragraph.
A command, when issued, must reformat the paragraph, based on the right margin, to match whichever paragraph style is being used. Alternatively, the formatting may be 'live'; i.e. it is reformatted with each keystroke.

Notice that all of the paragraphs above are left-justified: the left edge (apart from indent) is smooth, while the right edge is ragged.

Here is an outdented/hanging paragraph that is right-justified (right edge smooth, left edge ragged):

Code: Select all

Lorem ipsum dolor sit amet, consectetur adipiscing elit.  Etiam ultricies sagittis orci,
       nec consequat dolor consequat ac.  Nulla eleifend rutrum semper.  Sed fringilla,
    ligula eu gravida tempor, quam magna blandit dolor, quis imperdiet sapien erat eu
                nibh.  Nunc rutrum pulvinar nulla in facilisis.  Quisque feugiat purus in leo
          condimentum non congue eros consectetur.  Praesent dictum consequat nulla,
   bibendum rhoncus enim adipiscing et.  Pellentesque mi tellus, ornare id mattis ac,
                                               sollicitudin a erat.  Maecenas sit amet vehicula odio.
A block-indented paragraph that is center-justified (all lines centered, both edges ragged):

Code: Select all

          Lorem ipsum dolor sit amet, consectetur adipiscing elit.  Etiam ultricies sagittis
            orci, nec consequat dolor consequat ac.  Nulla eleifend rutrum semper.  Sed
        fringilla, ligula eu gravida tempor, quam magna blandit dolor, quis imperdiet sapien
         erat eu nibh.  Nunc rutrum pulvinar nulla in facilisis.  Quisque feugiat purus in leo
           condimentum non congue eros consectetur.  Praesent dictum consequat nulla,
        bibendum rhoncus enim adipiscing et.  Pellentesque mi tellus, ornare id mattis ac,
                         sollicitudin a erat.  Maecenas sit amet vehicula odio.
And a block-indented paragraph that is fully justified (both edges smooth):

Code: Select all

          Lorem ipsum dolor sit amet,  consectetur  adipiscing  elit.   Etiam  ultricies  sagittis
          orci,   nec  consequat  dolor  consequat  ac.   Nulla  eleifend  rutrum  semper.   Sed
          fringilla, ligula eu gravida tempor, quam magna blandit dolor, quis imperdiet sapien
          erat  eu  nibh.  Nunc rutrum pulvinar nulla in facilisis.  Quisque feugiat purus in leo
          condimentum  non  congue  eros  consectetur.   Praesent  dictum  consequat  nulla,
          bibendum  rhoncus enim adipiscing et.  Pellentesque mi tellus, ornare id mattis ac,
          sollicitudin a erat.  Maecenas sit amet vehicula odio.
Well, unfortunately, the forum doesn't seem to maintain the formatting placed in the blocks (the problem seems to be that the code blocks do not use monospace font)--is the description sufficient, or is there another way to maintain the formatting?
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post by Alexey »

>>Outdented paragraph which is r-aligned

I dont see right edge smooth [it is ragged like left]. Forum shows here monospaced font. And pasted to Cudatext, same.
Maybe picture of any editor?

But i got what to do. posted wish to CudaExt issue page.
qwerky
Posts: 172
Joined: 21.10.2013 00:58

Post by qwerky »

When entered in the posting window, it was aligned, but not when displayed in the forum; oh well.
Alexey wrote:But i got what to do. posted wish to CudaExt issue page.
Great!
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post by Alexey »

How indented/outdented types- work with right/center align?
pls example in monospaced fonts (type in Cuda, paste here).
qwerky
Posts: 172
Joined: 21.10.2013 00:58

Post by qwerky »

Alexey wrote:How indented/outdented types- work with right/center align?
pls example in monospaced fonts (type in Cuda, paste here).
Okay. A normal, indented paragraph should have the first line indented as compared to the other lines. This makes sense with left- or full-justification. With right-justification, the first line can still be indented more than the others, but that is subjective.

Left:

Code: Select all

     Lorem ipsum dolor sit amet, consectetur adipiscing elit.  Etiam ultricies
sagittis orci, nec consequat dolor consequat ac.  Nulla eleifend rutrum semper.
Sed fringilla, ligula eu gravida tempor, quam magna blandit dolor, quis
imperdiet sapien erat eu nibh.  Nunc rutrum pulvinar nulla in facilisis.
Quisque feugiat purus in leo condimentum non congue eros consectetur.  Praesent
dictum consequat nulla, bibendum rhoncus enim adipiscing et.  Pellentesque mi
tellus, ornare id mattis ac, sollicitudin a erat.  Maecenas sit amet vehicula
odio.
Full:

Code: Select all

     Lorem ipsum dolor sit amet, consectetur adipiscing elit.   Etiam  ultricies
sagittis  orci, nec consequat dolor consequat ac.  Nulla eleifend rutrum semper.
Sed fringilla,  ligula  eu  gravida  tempor,  quam  magna  blandit  dolor,  quis
imperdiet  sapien  erat  eu  nibh.   Nunc  rutrum  pulvinar  nulla in facilisis.
Quisque feugiat purus in leo condimentum non congue eros consectetur.   Praesent
dictum  consequat  nulla,  bibendum rhoncus enim adipiscing et.  Pellentesque mi
tellus, ornare id mattis ac, sollicitudin a erat.  Maecenas  sit  amet  vehicula
odio.
Right:

Code: Select all

                 Lorem ipsum dolor sit amet, consectetur adipiscing elit.  Etiam
      ultricies sagittis orci, nec consequat dolor consequat ac.  Nulla eleifend
     rutrum semper.  Sed fringilla, ligula eu gravida tempor, quam magna blandit
       dolor, quis imperdiet sapien erat eu nibh.  Nunc rutrum pulvinar nulla in
            facilisis.  Quisque feugiat purus in leo condimentum non congue eros
 consectetur.  Praesent dictum consequat nulla, bibendum rhoncus enim adipiscing
et.  Pellentesque mi tellus, ornare id mattis ac, sollicitudin a erat.  Maecenas
                                                         sit amet vehicula odio.
An outdented paragraph has all lines but the first, indented as compared to the first. This makes sense with left- and full-justification, and again with right-justification is a bit subjective.

Left:

Code: Select all

Lorem ipsum dolor sit amet, consectetur adipiscing elit.  Etiam ultricies
     sagittis orci, nec consequat dolor consequat ac.  Nulla eleifend rutrum
     semper.  Sed fringilla, ligula eu gravida tempor, quam magna blandit dolor,
     quis imperdiet sapien erat eu nibh.  Nunc rutrum pulvinar nulla in
     facilisis.  Quisque feugiat purus in leo condimentum non congue eros
     consectetur.  Praesent dictum consequat nulla, bibendum rhoncus enim
     adipiscing et.  Pellentesque mi tellus, ornare id mattis ac, sollicitudin a
     erat.  Maecenas sit amet vehicula odio.
Full:

Code: Select all

Lorem ipsum dolor  sit  amet,  consectetur  adipiscing  elit.   Etiam  ultricies
     sagittis  orci,  nec  consequat  dolor consequat ac.  Nulla eleifend rutrum
     semper.  Sed fringilla, ligula eu gravida tempor, quam magna blandit dolor,
     quis  imperdiet  sapien  erat  eu  nibh.   Nunc  rutrum  pulvinar  nulla in
     facilisis.  Quisque feugiat  purus  in  leo  condimentum  non  congue  eros
     consectetur.   Praesent  dictum  consequat  nulla,  bibendum  rhoncus  enim
     adipiscing et.  Pellentesque mi tellus, ornare id mattis ac, sollicitudin a
     erat.  Maecenas sit amet vehicula odio.
Right:

Code: Select all

       Lorem ipsum dolor sit amet, consectetur adipiscing elit.  Etiam ultricies
                sagittis orci, nec consequat dolor consequat ac.  Nulla eleifend
             rutrum semper.  Sed fringilla, ligula eu gravida tempor, quam magna
                 blandit dolor, quis imperdiet sapien erat eu nibh.  Nunc rutrum
                      pulvinar nulla in facilisis.  Quisque feugiat purus in leo
             condimentum non congue eros consectetur.  Praesent dictum consequat
            nulla, bibendum rhoncus enim adipiscing et.  Pellentesque mi tellus,
                    ornare id mattis ac, sollicitudin a erat.  Maecenas sit amet
                                                                  vehicula odio.
In all the examples above, I have chosen an indent of five spaces, and a column width of 80. The problem with right-justification on indented/outdented paragraphs is that the first-line indent does not necessarily match the author-chosen indent. So, the algorithm should ensure that the indent is at a minimum, the chosen indent, and may be more as necessary for the chosen alignment.

Alternatively, the algorithm can simply disallow right-justification with indented/outdented paragraphs.

With block-indented right-justification, the first line is no different than the other lines; so the algorithm simply ensures that every line has a minimum of the chosen amount of indentation:

Code: Select all

       Lorem ipsum dolor sit amet, consectetur adipiscing elit.  Etiam ultricies
         sagittis orci, nec consequat dolor consequat ac.  Nulla eleifend rutrum
     semper.  Sed fringilla, ligula eu gravida tempor, quam magna blandit dolor,
              quis imperdiet sapien erat eu nibh.  Nunc rutrum pulvinar nulla in
            facilisis.  Quisque feugiat purus in leo condimentum non congue eros
            consectetur.  Praesent dictum consequat nulla, bibendum rhoncus enim
     adipiscing et.  Pellentesque mi tellus, ornare id mattis ac, sollicitudin a
                                         erat.  Maecenas sit amet vehicula odio.
With center-justification, neither indented- nor outdented-pargraphs make any sense, since the objective is to have each line centered:

Code: Select all

   Lorem ipsum dolor sit amet, consectetur adipiscing elit.  Etiam ultricies
sagittis orci, nec consequat dolor consequat ac.  Nulla eleifend rutrum semper.
    Sed fringilla, ligula eu gravida tempor, quam magna blandit dolor, quis
    imperdiet sapien erat eu nibh.  Nunc rutrum pulvinar nulla in facilisis.
Quisque feugiat purus in leo condimentum non congue eros consectetur.  Praesent
 dictum consequat nulla, bibendum rhoncus enim adipiscing et.  Pellentesque mi
 tellus, ornare id mattis ac, sollicitudin a erat.  Maecenas sit amet vehicula
                                     odio.
Center-justification is also fine with a block-indented paragraph:

Code: Select all

      Lorem ipsum dolor sit amet, consectetur adipiscing elit.  Etiam ultricies
       sagittis orci, nec consequat dolor consequat ac.  Nulla eleifend rutrum
     semper.  Sed fringilla, ligula eu gravida tempor, quam magna blandit dolor,
         quis imperdiet sapien erat eu nibh.  Nunc rutrum pulvinar nulla in
        facilisis.  Quisque feugiat purus in leo condimentum non congue eros
        consectetur.  Praesent dictum consequat nulla, bibendum rhoncus enim
     adipiscing et.  Pellentesque mi tellus, ornare id mattis ac, sollicitudin a
                       erat.  Maecenas sit amet vehicula odio.
There is still another paragraph formatting option, a variation on the block-indent which some call quoted-block, in which the paragraph is indented from both the left and right margins. This works fine with center-justification:

Code: Select all

        Lorem ipsum dolor sit amet, consectetur adipiscing elit.  Etiam
       ultricies sagittis orci, nec consequat dolor consequat ac.  Nulla
     eleifend rutrum semper.  Sed fringilla, ligula eu gravida tempor, quam
     magna blandit dolor, quis imperdiet sapien erat eu nibh.  Nunc rutrum
     pulvinar nulla in facilisis.  Quisque feugiat purus in leo condimentum
         non congue eros consectetur.  Praesent dictum consequat nulla,
      bibendum rhoncus enim adipiscing et.  Pellentesque mi tellus, ornare
      id mattis ac, sollicitudin a erat.  Maecenas sit amet vehicula odio.
With left-justification:

Code: Select all

     Lorem ipsum dolor sit amet, consectetur adipiscing elit.  Etiam
     ultricies sagittis orci, nec consequat dolor consequat ac.  Nulla
     eleifend rutrum semper.  Sed fringilla, ligula eu gravida tempor, quam
     magna blandit dolor, quis imperdiet sapien erat eu nibh.  Nunc rutrum
     pulvinar nulla in facilisis.  Quisque feugiat purus in leo condimentum
     non congue eros consectetur.  Praesent dictum consequat nulla,
     bibendum rhoncus enim adipiscing et.  Pellentesque mi tellus, ornare
     id mattis ac, sollicitudin a erat.  Maecenas sit amet vehicula odio.
Also with right-justification:

Code: Select all

            Lorem ipsum dolor sit amet, consectetur adipiscing elit.  Etiam
          ultricies sagittis orci, nec consequat dolor consequat ac.  Nulla
     eleifend rutrum semper.  Sed fringilla, ligula eu gravida tempor, quam
      magna blandit dolor, quis imperdiet sapien erat eu nibh.  Nunc rutrum
     pulvinar nulla in facilisis.  Quisque feugiat purus in leo condimentum
             non congue eros consectetur.  Praesent dictum consequat nulla,
       bibendum rhoncus enim adipiscing et.  Pellentesque mi tellus, ornare
       id mattis ac, sollicitudin a erat.  Maecenas sit amet vehicula odio.
And of course, with full-justification:

Code: Select all

     Lorem ipsum  dolor  sit  amet,  consectetur  adipiscing  elit.   Etiam
     ultricies  sagittis  orci,  nec  consequat  dolor consequat ac.  Nulla
     eleifend rutrum semper.  Sed fringilla, ligula eu gravida tempor, quam
     magna  blandit dolor, quis imperdiet sapien erat eu nibh.  Nunc rutrum
     pulvinar nulla in facilisis.  Quisque feugiat purus in leo condimentum
     non   congue  eros  consectetur.   Praesent  dictum  consequat  nulla,
     bibendum rhoncus enim adipiscing et.  Pellentesque mi  tellus,  ornare
     id mattis ac, sollicitudin a erat.  Maecenas sit amet vehicula odio.
With any full-justification, the algorithm would pad each line with additional spaces as required, to make every line the required length. For each paragraph, a typical algorithm would start at the right end of odd-numbered lines, and at the left end of even-numbered lines (that is, odd- or even-numbered within the paragraph, not absolute line numbers), and would insert one space before the first word, then one space before the next word, until the required length is reached; or if the end of the line is reached first, then go back and add an additional space before each word to reach required length. The reason for starting at different ends, is so that the additional white-space is more evenly distributed, giving a more balanced appearance.

Other variations are possible, such as indented/outdented block or quote-block paragraphs. How many variations to implement is up to you.

Frankly, I don't think that I ever use right-justification, nor out-dented paragraphs (though some people do). But left-and full-justification with indented, and with block-indented/quoted-block (with or without a first-line indent) seem to me to be most important, followed by center-justification.

What do you and others think?
qwerky
Posts: 172
Joined: 21.10.2013 00:58

Post by qwerky »

Another consideration is the way in which a paragraph is represented, with the three main being:
1. Beginning a paragraph with a first-line indentation,
2. Separating one paragraph from another with a blank line, and
3. Ending a paragraph with a <return> (line-end), making the entire paragraph a single line, and relying upon the software to format the display of the paragraph.

Each method is, of course, preferred by some authors, and therefore should be handled by a complete software solution.

A note about word-wrap: currently, word-wrap is based on the screen right edge (and therefore re-wraps if the window is resized.) That is probably best for program code. But for general writing, word-wrap should be based on the right margin. Therefore, an option should be provided for this. In addition to a general option for this, you might consider making a lexer-specific override for the option.

In plain-text files there is no way, without employing some form of mark-up, to distinguish so-called 'soft' returns, from 'hard' returns which are represented by line-end sequences (CRLF, LF, CR). Therefore, right-margin word-wrap is especially important for general writing, and is essential for paragraph style no. 3 above.

Wikipedia article on indentation.
Wikipedia article on paragraphs.
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post by Alexey »

I told CudaExt author (r-align, center-align + some parag.types = not compatible, can disable or do like he wants)
Post Reply