help-nano
[Top][All Lists]
Advanced

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

Re: Softwrap at words for Markdown editing


From: Benno Schulenberg
Subject: Re: Softwrap at words for Markdown editing
Date: Wed, 2 Oct 2024 11:43:30 +0200
User-agent: Mozilla Thunderbird


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. The source compiled and
nano wraps. So, I am happy and will test this.

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.


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.
Because it looks silly that the wrapped part is longer that the unwrapped
part.  However, in your case, it would cause the URL to be broken probably
somewhere in the middle of a word.  So yeah, your private patch is the way
to go for you.


Benno

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]