1
0
mirror of https://github.com/sharkdp/bat synced 2026-07-23 17:03:18 +00:00

Moved tab expansion to happen after syntax highlighting.

This commit is contained in:
eth-p
2018-09-11 13:02:22 -07:00
parent eb6e43b9a9
commit b4096e5627
2 changed files with 18 additions and 10 deletions
+1 -2
View File
@@ -1,9 +1,8 @@
use console::AnsiCodeIterator;
/// Expand tabs like an ANSI-enabled expand(1).
pub fn expand(line: &str, width: usize) -> String {
pub fn expand(line: &str, width: usize, mut cursor: usize) -> String {
let mut buffer = String::with_capacity(line.len() * 2);
let mut cursor = 0;
for chunk in AnsiCodeIterator::new(line) {
match chunk {