bug-diffutils
[Top][All Lists]
Advanced

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

[bug-diffutils] bug#31105: bug#31105: [PATCH] Restart and reset ANSI esc


From: Dennis Lambe Jr.
Subject: [bug-diffutils] bug#31105: bug#31105: [PATCH] Restart and reset ANSI escapes on each line for compatibility with less -R
Date: Mon, 09 Apr 2018 11:53:17 -0400
User-agent: Internet Messaging Program (IMP) H3 (4.3)

The previous patch had an error in the first hunk for normal.c. I forgot to remove an "if" line when I removed the following conditional line. Due to its placement before a "for" line that tested the same condition, it didn't affect the behavior of the patch, but it was unsightly. I've attached an updated patch.

Quoting "Dennis Lambe Jr." <address@hidden>:

Hello!

GNU less can display ANSI-colored text with the -R flag, but this support has some limitations. One of them is that if an escape sequence starts on one line and ends on a different line, only the first line will be colored in less.

As a result, when diff creates colored output with multi-line deletes or adds, less will only color the first line.

I've attached a patch to reset ANSI color to the default at the end of every line and restart it at the beginning of the next. It patches normal and context mode. Side-by-side already worked in my testing.

I hope it's useful to you. Please let me know if there are changes you would like made before you can accept it.

--Dennis Lambe Jr.


Attachment: 99-color-escapes-every-line-v2.patch
Description: Text Data


reply via email to

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