]> git.madduck.net Git - etc/vim.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Don't colour diff headers white, only bold (GH-2691)
authorRichard Si <63936253+ichard26@users.noreply.github.com>
Wed, 15 Dec 2021 00:32:14 +0000 (19:32 -0500)
committerGitHub <noreply@github.com>
Wed, 15 Dec 2021 00:32:14 +0000 (19:32 -0500)
So people with light themed terminals can still read 'em.

CHANGES.md
src/black/output.py
tests/test_black.py

index 87e36f4dbe7e7b57cb22ebe63c5be012aec67344..c73295c4a0dad077a8fb0503135eb5ca6c063099 100644 (file)
@@ -7,6 +7,8 @@
 - Improve error message for invalid regular expression (#2678)
 - Fix mapping cases that contain as-expressions, like `case {"key": 1 | 2 as password}`
   (#2686)
+- No longer color diff headers white as it's unreadable in light themed terminals
+  (#2691)
 
 ## 21.12b0
 
index f030d0a0d08d67f07acc5516749ceb5095913a5a..9561d4b57d2a9b522de86a26a90d23413f09bd14 100644 (file)
@@ -81,7 +81,7 @@ def color_diff(contents: str) -> str:
     lines = contents.split("\n")
     for i, line in enumerate(lines):
         if line.startswith("+++") or line.startswith("---"):
-            line = "\033[1;37m" + line + "\033[0m"  # bold white, reset
+            line = "\033[1m" + line + "\033[0m"  # bold, reset
         elif line.startswith("@@"):
             line = "\033[36m" + line + "\033[0m"  # cyan, reset
         elif line.startswith("+"):
index 2d0a7dfd4e233ebecc906115c637e15dfcc145ba..468f00fcafb82c43a2cca3677cec918f3518b5f3 100644 (file)
@@ -200,7 +200,7 @@ class BlackTestCase(BlackBaseTestCase):
         )
         actual = result.output
         # Again, the contents are checked in a different test, so only look for colors.
-        self.assertIn("\033[1;37m", actual)
+        self.assertIn("\033[1m", actual)
         self.assertIn("\033[36m", actual)
         self.assertIn("\033[32m", actual)
         self.assertIn("\033[31m", actual)
@@ -323,7 +323,7 @@ class BlackTestCase(BlackBaseTestCase):
         actual = result.output
         # We check the contents of the diff in `test_expression_diff`. All
         # we need to check here is that color codes exist in the result.
-        self.assertIn("\033[1;37m", actual)
+        self.assertIn("\033[1m", actual)
         self.assertIn("\033[36m", actual)
         self.assertIn("\033[32m", actual)
         self.assertIn("\033[31m", actual)