Commit Diff


commit - 4bac9926bb6f27b5b065add4e43e12b7de16e1fb
commit + 88693f6126f7d090cc8e35aeb8f3abe9034542bd
blob - 023d633eaacfd5035d59f46015e1e45c6966b59f
blob + 04719d6ddbc8a30129f219162e953096a09910d2
--- ChangeLog
+++ ChangeLog
@@ -2,6 +2,7 @@
 
 	* defaults.c (load_default_keys): bind C-z to suspend-telescope
 	(load_default_keys): bind <home>/<end> to move-beginning/end-of-line
+	(config_setvari): add dont-wrap-pre
 
 	* cmd.c (cmd_suspend_telescope): add suspend-telescope
 
blob - 6fb7d4f402b9ab9316f2f9bec8531f18d80bfb61
blob + f513428dfdf1d983bf63609a8d00d9a32eac1d56
--- defaults.c
+++ defaults.c
@@ -31,6 +31,7 @@ int enable_colors = 1;
 int hide_pre_context = 0;
 int hide_pre_blocks = 0;
 int hide_pre_closing_line = 0;
+int dont_wrap_pre = 0;
 
 struct lineprefix line_prefixes[] = {
 	[LINE_TEXT] =		{ "",		"" },
@@ -412,7 +413,9 @@ config_setvari(const char *var, int val)
 		hide_pre_blocks = !!val;
 	} else if (!strcmp(var, "hide-pre-closing-line")) {
 		hide_pre_closing_line = !!val;
-	}else {
+	} else if (!strcmp(var, "dont-wrap-pre")) {
+		dont_wrap_pre = !!val;
+	} else {
 		return 0;
 	}
 
blob - 3a2cb7f594fb4347fd546333ef04d91ce1686f72
blob + d0ace0015bc35e6b0f553b07086557300bd06a42
--- defaults.h
+++ defaults.h
@@ -24,6 +24,7 @@ extern int	 enable_colors;
 extern int	 hide_pre_context;
 extern int	 hide_pre_blocks;
 extern int	 hide_pre_closing_line;
+extern int	 dont_wrap_pre;
 
 struct lineprefix {
 	const char	*prfx1;
blob - f384d75c5a506928a057b208d89ad261f1d2f67b
blob + a93c9a0e3c6d3dbe852563cb301d7d7b8673975a
--- telescope.1
+++ telescope.1
@@ -587,6 +587,9 @@ to the value
 Valid options are:
 .Pp
 .Bl -tag -width twelveletters -compact
+.It dont-wrap-pre
+.Pq integer
+If nonzero, don't wrap preformatted blocks.
 .It enable-colors
 .Pq integer
 If not zero, enable colours.
blob - 21017cbbfb15e3b832bd055f579577ddd3e68fe2
blob + 6f721e1cf457c9cca3fa254d23f6b3d885d30887
--- wrap.c
+++ wrap.c
@@ -17,6 +17,7 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include "defaults.h"
 #include "telescope.h"
 #include "utf8.h"
 
@@ -200,7 +201,9 @@ hardwrap_text(struct buffer *buffer, struct line *l, s
 		if (cur + w >= width) {
 			if (!push_line(buffer, l, start, lastchar - start, cont))
 				return 0;
-			cont = 1;
+			cont = L_CONTINUATION;
+			if (dont_wrap_pre)
+                                return 1;
 			cur = 0;
 			start = lastchar;
 		}