Commit 5864d975 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

tweaks: harmonize the routine for tabs with the one for spaces

parent 3ac37642
Showing with 5 additions and 4 deletions
+5 -4
...@@ -1849,18 +1849,19 @@ char *display_string(const char *buf, size_t start_col, size_t len, bool ...@@ -1849,18 +1849,19 @@ char *display_string(const char *buf, size_t start_col, size_t len, bool
#endif #endif
converted[index++] = ' '; converted[index++] = ' ';
start_col++; start_col++;
/* If buf contains a tab character, interpret it. */
} else if (*buf_mb == '\t') { } else if (*buf_mb == '\t') {
/* Show a tab as a visible character, or as as a space. */
#ifndef NANO_TINY #ifndef NANO_TINY
if (ISSET(WHITESPACE_DISPLAY)) { if (ISSET(WHITESPACE_DISPLAY)) {
int i; int i = 0;
for (i = 0; i < whitespace_len[0]; i++) while (i < whitespace_len[0])
converted[index++] = whitespace[i]; converted[index++] = whitespace[i++];
} else } else
#endif #endif
converted[index++] = ' '; converted[index++] = ' ';
start_col++; start_col++;
/* Fill the tab up with the required number of spaces. */
while (start_col % tabsize != 0) { while (start_col % tabsize != 0) {
converted[index++] = ' '; converted[index++] = ' ';
start_col++; start_col++;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment