1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-09-02 19:32:25 +01: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

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 {