git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/3] Act on WS_WARN for ws_mode_space_before_tab.

From
David Symonds <dsymonds@gmail.com>
Date
Nov 2, 2007, 13:34 UTC
Message-ID
<11940104621856-git-send-email-dsymonds@gmail.com>
In-Reply-To
<11940104611948-git-send-email-dsymonds@gmail.com>
Signed-off-by: David Symonds <dsymonds@gmail.com>
---
 diff.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/diff.c b/diff.c
index a6aaaf7..6f9b624 100644
--- a/diff.c
+++ b/diff.c
@@ -508,8 +508,12 @@ static void emit_line_with_ws(int nparents,
 	for (i = col0; i < len; i++) {
 		if (line[i] == '\t') {
 			last_tab_in_indent = i;
-			if (0 <= last_space_in_indent)
-				need_highlight_leading_space = 1;
+			if ((ws_mode_space_before_tab != WS_OKAY) &&
+			    (0 <= last_space_in_indent)) {
+				if (ws_mode_space_before_tab == WS_WARN)
+					need_highlight_leading_space = 1;
+				/* TODO: handle WS_ERROR and WS_AUTOFIX */
+			}
 		}
 		else if (line[i] == ' ')
 			last_space_in_indent = i;
-- 
1.5.3.1
Previous: David SymondsNext: David Symonds
Message 2 of 5 in “Implement parsing for new core.whitespace.* options.”
  1. 1/3 Implement parsing for new core.whitespace.* options.David Symonds, Nov 2, 2007
  2. 2/3 Act on WS_WARN for ws_mode_space_before_tab.David Symonds, Nov 2, 2007
  3. 3/3 Act on WS_WARN for ws_mode_trailing.David Symonds, Nov 2, 2007
  4. David SymondsNov 2, 2007
  5. BazNov 2, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.