Re: Softwrap at words for Markdown editing

Andreas Schamanek <[email protected]> Wed, 2 Oct 2024 18:10:10 +0200 (CEST)
Newsgroups gmane.editors.nano.general
Message-ID <[email protected]>
On Wed, 2 Oct 2024, at 11:43, Benno Schulenberg wrote:

> Op 30-09-2024 om 21:26 schreef Andreas Schamanek:
>> I've never done much coding in C, but my brain tricked me into 
>> believing you wrote it was "simple" to make a patch, and so I gave 
>> it a try :) I only added ']' as another character where nano can 
>> softwrap.

> If you made this change:
>
> -       if (ISSET(AT_BLANKS) && is_blank_char(text) && column < rightside) {
> +       if (ISSET(AT_BLANKS) && (is_blank_char(text) || *text == ']') &&
> +                                    column < rightside) {
>
> then that should work.

My patch was not as elegant and concise as yours, but functionally 
equivalent. Thanks a lot for showing how it's done properly.

> Personally I was considering this change:
>
> -       if (ISSET(AT_BLANKS) && is_blank_char(text) && column < rightside) {
> +       if (ISSET(AT_BLANKS) && column > (COLS / 2) && column < rightside &&
> +                                   is_blank_char(text)) {
>
> That is: break at whitespace only after the vertical middle of the screen.

This sounded like a very good idea, and I gave it a try. But indeed, 
for Markdown I prefer to allow a wrap after ']'.

Thanks a lot for your support!

-- 
-- Andreas

      :-)