nano-devel
[Top][All Lists]
Advanced

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

[Nano-devel] [PATCH] wrapping: use "smart" autoindenting only when hard-


From: Benno Schulenberg
Subject: [Nano-devel] [PATCH] wrapping: use "smart" autoindenting only when hard-wrapping is enabled
Date: Wed, 30 May 2018 21:05:25 +0200

The smart indenting is only needed when automatic hard-wrapping is on
(that is: when 'nowrap' is not in effect -- when writing prose).  When
writing code, the user most likely uses --nowrap, which will make nano
indent a new line always to the same amount as the preceding line --
when --autoindent is in effect, of course.
---
 src/text.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/text.c b/src/text.c
index e00cf2fa..a5b9e4be 100644
--- a/src/text.c
+++ b/src/text.c
@@ -1035,7 +1035,7 @@ void do_enter(void)
 #ifdef ENABLE_JUSTIFY
                /* If the next line is in this same paragraph, use its 
indentation
                 * as the model, as it is more likely to be what the user 
wants. */
-               if (sampleline->next && inpar(sampleline->next) &&
+               if (!ISSET(NO_WRAP) && sampleline->next && 
inpar(sampleline->next) &&
                                                                
!begpar(sampleline->next, 0))
                        sampleline = sampleline->next;
 #endif
-- 
2.17.0




reply via email to

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