Re: Harmful LESS flags

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

 



On Thu, Apr 24, 2014 at 12:29:21PM -0700, Junio C Hamano wrote:

> David Kastrup <dak@xxxxxxx> writes:
> 
> > Junio C Hamano <gitster@xxxxxxxxx> writes:
> >
> >> Traditionally, because the tool grew in a context of being used in a
> >> project whose participants are at least not malicious, always having
> >> to be on the lookout for fear of middle-of-line tabs hiding bad
> >> contents near the right edges of lines has never been an issue.
> >
> > My beef is not with "hiding bad contents" but with "hiding contents".
> > It makes the output useless for seeing what is actually happening as
> > soon as the option starts having an effect.
> 
> My suspicion is that one of the reasons why S was chosen to be in
> the default was to mildly discourage people from busting the usual
> line-length limit, but I am not Linus ;-)

I would think it's the opposite. Long lines look _horrible_ without
"-S", as they get wrapped at awkward points. Using "-S" means that long
lines don't bug you, unless you really want to scroll over and see the
content.

I really think the right solution here is to teach less to make it more
obvious that there is something worth scrolling over to. Here's a very
rough patch for less, if you want to see what I'm thinking of.

diff --git a/input.c b/input.c
index b211323..01aa411 100755
--- a/input.c
+++ b/input.c
@@ -178,6 +178,7 @@ get_forw_line:
 			 */
 			if (chopline || hshift > 0)
 			{
+				set_chopped_marker(ch_tell()-1);
 				do
 				{
 					if (ABORT_SIGS())
diff --git a/line.c b/line.c
index 1eb3914..b3358a0 100755
--- a/line.c
+++ b/line.c
@@ -1080,6 +1080,20 @@ set_status_col(c)
 	attr[0] = AT_NORMAL|AT_HILITE;
 }
 
+	public void
+set_chopped_marker(pos)
+	    POSITION pos;
+{
+	/*
+	 * Roll back output by one character; probably
+	 * we need to actually walk curr back further
+	 * for multibyte characters?
+	 */
+	column--;
+	curr--;
+	store_char('>', AT_NORMAL|AT_HILITE, NULL, pos);
+}
+
 /*
  * Get a character from the current line.
  * Return the character as the function return value,

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]