Repository: rust-lang/annotate-snippets-rs
Pull request #146 (2024-09-09 15:04:56)

perf: Offer 'simd' feature for faster folding 
Inspired by https://purplesyringa.moe/blog/i-sped-up-serde-json-strings-by-20-percent/

```console
$ cargo bench && cargo bench -F simd
   Compiling annotate-snippets v0.11.2 (/home/epage/src/personal/annotate-snippets-rs)
    Finished `bench` profile [optimized] target(s) in 0.99s
     Running unittests src/lib.rs (target/release/deps/annotate_snippets-b51bb37991a7f496)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running benches/bench.rs (target/release/deps/bench-468ba612503afee1)
Timer precision: 18 ns
bench         fastest       │ slowest       │ median        │ mean          │ samples │ iters
├─ fold                     │               │               │               │         │
│  ├─ 0       1.911 µs      │ 19.44 µs      │ 1.943 µs      │ 2.146 µs      │ 100     │ 100
│  ├─ 1       1.916 µs      │ 3.158 µs      │ 1.973 µs      │ 1.982 µs      │ 100     │ 100
│  ├─ 10      2.121 µs      │ 6.05 µs       │ 2.225 µs      │ 2.281 µs      │ 100     │ 100
│  ├─ 100     3.706 µs      │ 7.007 µs      │ 3.83 µs       │ 3.876 µs      │ 100     │ 100
│  ├─ 1000    19.42 µs      │ 25.61 µs      │ 19.48 µs      │ 19.64 µs      │ 100     │ 100
│  ├─ 10000   111.2 µs      │ 204.2 µs      │ 127 µs        │ 133.6 µs      │ 100     │ 100
│  ╰─ 100000  1.094 ms      │ 1.747 ms      │ 1.137 ms      │ 1.158 ms      │ 100     │ 100
╰─ simple     10.14 µs      │ 40.27 µs      │ 10.5 µs       │ 11.01 µs      │ 100     │ 100

   Compiling annotate-snippets v0.11.2 (/home/epage/src/personal/annotate-snippets-rs)
    Finished `bench` profile [optimized] target(s) in 0.99s
     Running unittests src/lib.rs (target/release/deps/annotate_snippets-9d4024ac94675e6a)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running benches/bench.rs (target/release/deps/bench-d5470149969acbb8)
Timer precision: 13 ns
bench         fastest       │ slowest       │ median        │ mean          │ samples │ iters
├─ fold                     │               │               │               │         │
│  ├─ 0       1.164 µs      │ 13.91 µs      │ 1.208 µs      │ 1.408 µs      │ 100     │ 100
│  ├─ 1       1.188 µs      │ 4.289 µs      │ 1.234 µs      │ 1.277 µs      │ 100     │ 100
│  ├─ 10      1.259 µs      │ 3.822 µs      │ 1.319 µs      │ 1.419 µs      │ 100     │ 100
│  ├─ 100     1.312 µs      │ 2.732 µs      │ 1.412 µs      │ 1.519 µs      │ 100     │ 100
│  ├─ 1000    1.917 µs      │ 5.52 µs       │ 2 µs          │ 2.085 µs      │ 100     │ 100
│  ├─ 10000   7.195 µs      │ 29.55 µs      │ 7.325 µs      │ 7.638 µs      │ 100     │ 100
│  ╰─ 100000  59.08 µs      │ 403 µs        │ 61.1 µs       │ 65.52 µs      │ 100     │ 100
╰─ simple     9.92 µs       │ 19.09 µs      │ 10.33 µs      │ 10.91 µs      │ 100     │ 100
```
The upper bound for this benchmark was taken from https://github.com/crate-ci/typos/blob/786c825f1753f87b02d24770e3f4ec8043d9084a/crates/typos-dict/src/word_codegen.rs


Patch:
diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml
index 2da233d..35b3da8 100644
--- a/.github/workflows/audit.yml
+++ b/.github/workflows/audit.yml
@@ -47,7 +47,7 @@ jobs:
           - bans licenses sources
     steps:
     - uses: actions/checkout@v4
-    - uses: EmbarkStudios/cargo-deny-action@v2
+    - uses: EmbarkStudios/cargo-deny-action@v1
       with:
         command: check ${{ matrix.checks }}
         rust-version: stable
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 89809f5..f07c714 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -64,7 +64,7 @@ jobs:
     - uses: Swatinem/rust-cache@v2
     - uses: taiki-e/install-action@cargo-hack
     - name: Default features
-      run: cargo hack check --feature-powerset --locked --rust-version --ignore-private --workspace --all-targets
+      run: cargo hack check --feature-powerset --locked --rust-version --ignore-private --workspace --lib --bins
   lockfile:
     runs-on: ubuntu-latest
     steps:
@@ -86,7 +86,7 @@ jobs:
     - name: Install Rust
       uses: dtolnay/rust-toolchain@stable
       with:
-        toolchain: "1.80"  # STABLE
+        toolchain: "1.78"  # STABLE
     - uses: Swatinem/rust-cache@v2
     - name: Check documentation
       env:
@@ -101,7 +101,7 @@ jobs:
     - name: Install Rust
       uses: dtolnay/rust-toolchain@stable
       with:
-        toolchain: "1.80"  # STABLE
+        toolchain: "1.78"  # STABLE
         components: rustfmt
     - uses: Swatinem/rust-cache@v2
     - name: Check formatting
@@ -117,7 +117,7 @@ jobs:
     - name: Install Rust
       uses: dtolnay/rust-toolchain@stable
       with:
-        toolchain: "1.80"  # STABLE
+        toolchain: "1.78"  # STABLE
         components: clippy
     - uses: Swatinem/rust-cache@v2
     - name: Install SARIF tools
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1c7d2d2..51665a9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,14 +7,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
 <!-- next-header -->
 ## [Unreleased] - ReleaseDate
 
-## [0.11.4] - 2024-06-15
-
-### Fixes
-
-- Annotations for `\r\n` are now correctly handled [#131](https://github.com/rust-lang/annotate-snippets-rs/pull/131)
-
-## [0.11.3] - 2024-06-06
-
 ### Fixes
 
 - Dropped MSRV to 1.65
@@ -144,9 +136,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
 - Update the syntax to Rust 2018 idioms. (#4)
 
 <!-- next-url -->
-[Unreleased]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.11.4...HEAD
-[0.11.4]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.11.3...0.11.4
-[0.11.3]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.11.2...0.11.3
+[Unreleased]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.11.2...HEAD
 [0.11.2]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.11.1...0.11.2
 [0.11.1]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.11.0...0.11.1
 [0.11.0]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.10.2...0.11.0
diff --git a/Cargo.lock b/Cargo.lock
index 226775f..02b8812 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -11,22 +11,16 @@ dependencies = [
  "memchr",
 ]
 
-[[package]]
-name = "anes"
-version = "0.1.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299"
-
 [[package]]
 name = "annotate-snippets"
-version = "0.11.4"
+version = "0.11.2"
 dependencies = [
- "annotate-snippets",
- "anstream 0.6.15",
+ "anstream 0.6.14",
  "anstyle",
- "criterion",
  "difference",
+ "divan",
  "glob",
+ "memchr",
  "serde",
  "snapbox",
  "toml",
@@ -51,9 +45,9 @@ dependencies = [
 
 [[package]]
 name = "anstream"
-version = "0.6.15"
+version = "0.6.14"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526"
+checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b"
 dependencies = [
  "anstyle",
  "anstyle-parse",
@@ -103,7 +97,7 @@ version = "0.1.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "bbbf0bf947d663010f0b4132f28ca08da9151f3b9035fa7578a38de521c1d1aa"
 dependencies = [
- "anstream 0.6.15",
+ "anstream 0.6.14",
  "anstyle",
  "anstyle-lossy",
  "html-escape",
@@ -131,10 +125,10 @@ dependencies = [
 ]
 
 [[package]]
-name = "autocfg"
-version = "1.3.0"
+name = "bitflags"
+version = "1.3.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0"
+checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
 
 [[package]]
 name = "bstr"
@@ -146,51 +140,12 @@ dependencies = [
  "serde",
 ]
 
-[[package]]
-name = "bumpalo"
-version = "3.14.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec"
-
-[[package]]
-name = "cast"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5"
-
 [[package]]
 name = "cfg-if"
 version = "1.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
 
-[[package]]
-name = "ciborium"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e"
-dependencies = [
- "ciborium-io",
- "ciborium-ll",
- "serde",
-]
-
-[[package]]
-name = "ciborium-io"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757"
-
-[[package]]
-name = "ciborium-ll"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9"
-dependencies = [
- "ciborium-io",
- "half",
-]
-
 [[package]]
 name = "clap"
 version = "4.3.24"
@@ -212,6 +167,7 @@ dependencies = [
  "anstyle",
  "clap_lex",
  "strsim",
+ "terminal_size",
 ]
 
 [[package]]
@@ -239,83 +195,51 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422"
 
 [[package]]
-name = "criterion"
-version = "0.5.1"
+name = "condtype"
+version = "1.3.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f"
-dependencies = [
- "anes",
- "cast",
- "ciborium",
- "clap",
- "criterion-plot",
- "is-terminal",
- "itertools",
- "num-traits",
- "once_cell",
- "oorandom",
- "plotters",
- "rayon",
- "regex",
- "serde",
- "serde_derive",
- "serde_json",
- "tinytemplate",
- "walkdir",
-]
+checksum = "baf0a07a401f374238ab8e2f11a104d2851bf9ce711ec69804834de8af45c7af"
 
 [[package]]
-name = "criterion-plot"
-version = "0.5.0"
+name = "difference"
+version = "2.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1"
-dependencies = [
- "cast",
- "itertools",
-]
+checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198"
 
 [[package]]
-name = "crossbeam-deque"
-version = "0.8.5"
+name = "divan"
+version = "0.1.14"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d"
+checksum = "a0d567df2c9c2870a43f3f2bd65aaeb18dbce1c18f217c3e564b4fbaeb3ee56c"
 dependencies = [
- "crossbeam-epoch",
- "crossbeam-utils",
+ "cfg-if",
+ "clap",
+ "condtype",
+ "divan-macros",
+ "libc",
+ "regex-lite",
 ]
 
 [[package]]
-name = "crossbeam-epoch"
-version = "0.9.18"
+name = "divan-macros"
+version = "0.1.14"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e"
+checksum = "27540baf49be0d484d8f0130d7d8da3011c32a44d4fc873368154f1510e574a2"
 dependencies = [
- "crossbeam-utils",
+ "proc-macro2",
+ "quote",
+ "syn",
 ]
 
 [[package]]
-name = "crossbeam-utils"
-version = "0.8.20"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80"
-
-[[package]]
-name = "crunchy"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7"
-
-[[package]]
-name = "difference"
-version = "2.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198"
-
-[[package]]
-name = "either"
-version = "1.12.0"
+name = "errno"
+version = "0.3.9"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b"
+checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba"
+dependencies = [
+ "libc",
+ "windows-sys 0.52.0",
+]
 
 [[package]]
 name = "escape8259"
@@ -357,15 +281,6 @@ dependencies = [
  "regex-syntax",
 ]
 
-[[package]]
-name = "half"
-version = "2.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "02b4af3693f1b705df946e9fe5631932443781d0aabb423b62fcd4d73f6d2fd0"
-dependencies = [
- "crunchy",
-]
-
 [[package]]
 name = "heck"
 version = "0.4.1"
@@ -404,6 +319,17 @@ dependencies = [
  "winapi-util",
 ]
 
+[[package]]
+name = "io-lifetimes"
+version = "1.0.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2"
+dependencies = [
+ "hermit-abi",
+ "libc",
+ "windows-sys 0.48.0",
+]
+
 [[package]]
 name = "is-terminal"
 version = "0.4.12"
@@ -424,30 +350,12 @@ dependencies = [
  "is-terminal",
 ]
 
-[[package]]
-name = "itertools"
-version = "0.10.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473"
-dependencies = [
- "either",
-]
-
 [[package]]
 name = "itoa"
 version = "1.0.11"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b"
 
-[[package]]
-name = "js-sys"
-version = "0.3.69"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d"
-dependencies = [
- "wasm-bindgen",
-]
-
 [[package]]
 name = "lazy_static"
 version = "1.4.0"
@@ -472,6 +380,12 @@ dependencies = [
  "threadpool",
 ]
 
+[[package]]
+name = "linux-raw-sys"
+version = "0.3.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519"
+
 [[package]]
 name = "log"
 version = "0.4.21"
@@ -480,9 +394,9 @@ checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c"
 
 [[package]]
 name = "memchr"
-version = "2.7.2"
+version = "2.7.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d"
+checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
 
 [[package]]
 name = "normalize-line-endings"
@@ -490,15 +404,6 @@ version = "0.3.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be"
 
-[[package]]
-name = "num-traits"
-version = "0.2.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
-dependencies = [
- "autocfg",
-]
-
 [[package]]
 name = "num_cpus"
 version = "1.16.0"
@@ -515,12 +420,6 @@ version = "1.19.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
 
-[[package]]
-name = "oorandom"
-version = "11.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575"
-
 [[package]]
 name = "os_pipe"
 version = "1.2.0"
@@ -531,34 +430,6 @@ dependencies = [
  "windows-sys 0.52.0",
 ]
 
-[[package]]
-name = "plotters"
-version = "0.3.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a15b6eccb8484002195a3e44fe65a4ce8e93a625797a063735536fd59cb01cf3"
-dependencies = [
- "num-traits",
- "plotters-backend",
- "plotters-svg",
- "wasm-bindgen",
- "web-sys",
-]
-
-[[package]]
-name = "plotters-backend"
-version = "0.3.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "414cec62c6634ae900ea1c56128dfe87cf63e7caece0852ec76aba307cebadb7"
-
-[[package]]
-name = "plotters-svg"
-version = "0.3.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "81b30686a7d9c3e010b84284bdd26a29f2138574f52f5eb6f794fc0ad924e705"
-dependencies = [
- "plotters-backend",
-]
-
 [[package]]
 name = "proc-macro2"
 version = "1.0.85"
@@ -577,26 +448,6 @@ dependencies = [
  "proc-macro2",
 ]
 
-[[package]]
-name = "rayon"
-version = "1.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa"
-dependencies = [
- "either",
- "rayon-core",
-]
-
-[[package]]
-name = "rayon-core"
-version = "1.12.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2"
-dependencies = [
- "crossbeam-deque",
- "crossbeam-utils",
-]
-
 [[package]]
 name = "regex"
 version = "1.10.4"
@@ -620,12 +471,32 @@ dependencies = [
  "regex-syntax",
 ]
 
+[[package]]
+name = "regex-lite"
+version = "0.1.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "53a49587ad06b26609c52e423de037e7f57f20d53535d66e08c695f347df952a"
+
 [[package]]
 name = "regex-syntax"
 version = "0.8.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56"
 
+[[package]]
+name = "rustix"
+version = "0.37.27"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2"
+dependencies = [
+ "bitflags",
+ "errno",
+ "io-lifetimes",
+ "libc",
+ "linux-raw-sys",
+ "windows-sys 0.48.0",
+]
+
 [[package]]
 name = "rustversion"
 version = "1.0.17"
@@ -649,18 +520,18 @@ dependencies = [
 
 [[package]]
 name = "serde"
-version = "1.0.204"
+version = "1.0.203"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12"
+checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094"
 dependencies = [
  "serde_derive",
 ]
 
 [[package]]
 name = "serde_derive"
-version = "1.0.204"
+version = "1.0.203"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222"
+checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -686,11 +557,11 @@ checksum = "fa42c91313f1d05da9b26f267f931cf178d4aba455b4c4622dd7355eb80c6640"
 
 [[package]]
 name = "snapbox"
-version = "0.6.16"
+version = "0.6.7"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "027c936207f85d10d015e21faf5c676c7e08c453ed371adf55c0874c443ca77a"
+checksum = "94204b12a4d3550420babdb4148c6639692e4e3e61060866929c5107f208aeb6"
 dependencies = [
- "anstream 0.6.15",
+ "anstream 0.6.14",
  "anstyle",
  "anstyle-svg",
  "escargot",
@@ -706,11 +577,11 @@ dependencies = [
 
 [[package]]
 name = "snapbox-macros"
-version = "0.3.10"
+version = "0.3.9"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "16569f53ca23a41bb6f62e0a5084aa1661f4814a67fa33696a79073e03a664af"
+checksum = "b1f4c14672714436c09254801c934b203196a51182a5107fb76591c7cc56424d"
 dependencies = [
- "anstream 0.6.15",
+ "anstream 0.6.14",
 ]
 
 [[package]]
@@ -739,6 +610,16 @@ dependencies = [
  "winapi-util",
 ]
 
+[[package]]
+name = "terminal_size"
+version = "0.2.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8e6bf6f19e9f8ed8d4048dc22981458ebcf406d67e94cd422e5ecd73d63b3237"
+dependencies = [
+ "rustix",
+ "windows-sys 0.48.0",
+]
+
 [[package]]
 name = "thread_local"
 version = "1.1.8"
@@ -758,16 +639,6 @@ dependencies = [
  "num_cpus",
 ]
 
-[[package]]
-name = "tinytemplate"
-version = "1.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc"
-dependencies = [
- "serde",
- "serde_json",
-]
-
 [[package]]
 name = "toml"
 version = "0.5.11"
@@ -779,9 +650,9 @@ dependencies = [
 
 [[package]]
 name = "tryfn"
-version = "0.2.3"
+version = "0.2.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5fe242ee9e646acec9ab73a5c540e8543ed1b107f0ce42be831e0775d423c396"
+checksum = "493e1390312bb94363f762687be32a1bd01c3333dfad25a5a7fffab1edc64839"
 dependencies = [
  "ignore",
  "libtest-mimic",
@@ -831,70 +702,6 @@ dependencies = [
  "winapi-util",
 ]
 
-[[package]]
-name = "wasm-bindgen"
-version = "0.2.92"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8"
-dependencies = [
- "cfg-if",
- "wasm-bindgen-macro",
-]
-
-[[package]]
-name = "wasm-bindgen-backend"
-version = "0.2.92"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da"
-dependencies = [
- "bumpalo",
- "log",
- "once_cell",
- "proc-macro2",
- "quote",
- "syn",
- "wasm-bindgen-shared",
-]
-
-[[package]]
-name = "wasm-bindgen-macro"
-version = "0.2.92"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726"
-dependencies = [
- "quote",
- "wasm-bindgen-macro-support",
-]
-
-[[package]]
-name = "wasm-bindgen-macro-support"
-version = "0.2.92"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
- "wasm-bindgen-backend",
- "wasm-bindgen-shared",
-]
-
-[[package]]
-name = "wasm-bindgen-shared"
-version = "0.2.92"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96"
-
-[[package]]
-name = "web-sys"
-version = "0.3.69"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef"
-dependencies = [
- "js-sys",
- "wasm-bindgen",
-]
-
 [[package]]
 name = "winapi-util"
 version = "0.1.8"
diff --git a/Cargo.toml b/Cargo.toml
index d323686..d59fa9f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "annotate-snippets"
-version = "0.11.4"
+version = "0.11.2"
 edition = "2021"
 rust-version = "1.65"  # MSRV
 authors = ["Zibi Braniecki <gandalf@mozilla.com>"]
@@ -25,13 +25,13 @@ maintenance = { status = "actively-developed" }
 
 [dependencies]
 anstyle = "1.0.4"
+memchr = { version = "2.7.4", optional = true }
 unicode-width = "0.1.11"
 
 [dev-dependencies]
-annotate-snippets = { path = ".", features = ["testing-colors"] }
 anstream = "0.6.13"
-criterion = "0.5.1"
 difference = "2.0.0"
+divan = "0.1.14"
 glob = "0.3.1"
 serde = { version = "1.0.199", features = ["derive"] }
 snapbox = { version = "0.6.0", features = ["diff", "term-svg", "cmd", "examples"] }
@@ -39,7 +39,7 @@ toml = "0.5.11"
 tryfn = "0.2.1"
 
 [[bench]]
-name = "simple"
+name = "bench"
 harness = false
 
 [[test]]
@@ -48,6 +48,7 @@ harness = false
 
 [features]
 default = []
+simd = ["memchr"]
 testing-colors = []
 
 [lints.rust]
diff --git a/benches/bench.rs b/benches/bench.rs
new file mode 100644
index 0000000..9747954
--- /dev/null
+++ b/benches/bench.rs
@@ -0,0 +1,89 @@
+use annotate_snippets::{Level, Renderer, Snippet};
+
+#[divan::bench]
+fn simple() -> String {
+    let source = r#") -> Option<String> {
+    for ann in annotations {
+        match (ann.range.0, ann.range.1) {
+            (None, None) => continue,
+            (Some(start), Some(end)) if start > end_index => continue,
+            (Some(start), Some(end)) if start >= start_index => {
+                let label = if let Some(ref label) = ann.label {
+                    format!(" {}", label)
+                } else {
+                    String::from("")
+                };
+
+                return Some(format!(
+                    "{}{}{}",
+                    " ".repeat(start - start_index),
+                    "^".repeat(end - start),
+                    label
+                ));
+            }
+            _ => continue,
+        }
+    }"#;
+    let message = Level::Error.title("mismatched types").id("E0308").snippet(
+        Snippet::source(source)
+            .line_start(51)
+            .origin("src/format.rs")
+            .annotation(
+                Level::Warning
+                    .span(5..19)
+                    .label("expected `Option<String>` because of return type"),
+            )
+            .annotation(
+                Level::Error
+                    .span(26..724)
+                    .label("expected enum `std::option::Option`"),
+            ),
+    );
+
+    let renderer = Renderer::plain();
+    let rendered = renderer.render(message).to_string();
+    rendered
+}
+
+#[divan::bench(args=[0, 1, 10, 100, 1_000, 10_000, 100_000])]
+fn fold(bencher: divan::Bencher<'_, '_>, context: usize) {
+    bencher
+        .with_inputs(|| {
+            let line = "012345678901234567890123456789";
+            let mut input = String::new();
+            for _ in 1..=context {
+                input.push_str(line);
+                input.push('\n');
+            }
+            let span_start = input.len() + line.len();
+            let span = span_start..span_start;
+
+            input.push_str(line);
+            input.push('\n');
+            for _ in 1..=context {
+                input.push_str(line);
+                input.push('\n');
+            }
+            (input, span)
+        })
+        .bench_values(|(input, span)| {
+            let message = Level::Error.title("mismatched types").id("E0308").snippet(
+                Snippet::source(&input)
+                    .fold(true)
+                    .origin("src/format.rs")
+                    .annotation(
+                        Level::Warning
+                            .span(span)
+                            .label("expected `Option<String>` because of return type"),
+                    ),
+            );
+
+            let renderer = Renderer::plain();
+            let rendered = renderer.render(message).to_string();
+            rendered
+        });
+}
+
+fn main() {
+    divan::main();
+}
diff --git a/benches/simple.rs b/benches/simple.rs
deleted file mode 100644
index 723793e..0000000
--- a/benches/simple.rs
+++ /dev/null
@@ -1,58 +0,0 @@
-#![allow(clippy::unit_arg)]
-#[macro_use]
-extern crate criterion;
-
-use criterion::{black_box, Criterion};
-
-use annotate_snippets::{Level, Renderer, Snippet};
-
-fn create_snippet(renderer: Renderer) {
-    let source = r#") -> Option<String> {
-    for ann in annotations {
-        match (ann.range.0, ann.range.1) {
-            (None, None) => continue,
-            (Some(start), Some(end)) if start > end_index => continue,
-            (Some(start), Some(end)) if start >= start_index => {
-                let label = if let Some(ref label) = ann.label {
-                    format!(" {}", label)
-                } else {
-                    String::from("")
-                };
-
-                return Some(format!(
-                    "{}{}{}",
-                    " ".repeat(start - start_index),
-                    "^".repeat(end - start),
-                    label
-                ));
-            }
-            _ => continue,
-        }
-    }"#;
-    let message = Level::Error.title("mismatched types").id("E0308").snippet(
-        Snippet::source(source)
-            .line_start(51)
-            .origin("src/format.rs")
-            .annotation(
-                Level::Warning
-                    .span(5..19)
-                    .label("expected `Option<String>` because of return type"),
-            )
-            .annotation(
-                Level::Error
-                    .span(26..724)
-                    .label("expected enum `std::option::Option`"),
-            ),
-    );
-
-    let _result = renderer.render(message).to_string();
-}
-
-pub fn criterion_benchmark(c: &mut Criterion) {
-    c.bench_function("format", |b| {
-        b.iter(|| black_box(create_snippet(Renderer::plain())));
-    });
-}
-
-criterion_group!(benches, criterion_benchmark);
-criterion_main!(benches);
diff --git a/examples/expected_type.svg b/examples/expected_type.svg
index ed19ef3..a355dbc 100644
--- a/examples/expected_type.svg
+++ b/examples/expected_type.svg
@@ -23,11 +23,11 @@
 </tspan>
     <tspan x="10px" y="46px"><tspan>  </tspan><tspan class="fg-bright-blue bold">--&gt;</tspan><tspan> examples/footer.rs:29:25</tspan>
 </tspan>
-    <tspan x="10px" y="64px"><tspan>   </tspan><tspan class="fg-bright-blue bold">|</tspan>
+    <tspan x="10px" y="64px"><tspan class="fg-bright-blue bold">   |</tspan>
 </tspan>
     <tspan x="10px" y="82px"><tspan class="fg-bright-blue bold">26 |</tspan><tspan>                 annotations: vec![SourceAnnotation {</tspan>
 </tspan>
-    <tspan x="10px" y="100px"><tspan>   </tspan><tspan class="fg-bright-blue bold">|</tspan><tspan>                                   </tspan><tspan class="fg-bright-blue bold">----------------</tspan><tspan> </tspan><tspan class="fg-bright-blue bold">info: while parsing this struct</tspan>
+    <tspan x="10px" y="100px"><tspan class="fg-bright-blue bold">   |</tspan><tspan class="fg-bright-blue bold">                                   ----------------</tspan><tspan> </tspan><tspan class="fg-bright-blue bold">info</tspan><tspan class="fg-bright-blue bold">: while parsing this struct</tspan>
 </tspan>
     <tspan x="10px" y="118px"><tspan class="fg-bright-blue bold">27 |</tspan><tspan>                 label: "expected struct `annotate_snippets::snippet::Slice`, found reference"</tspan>
 </tspan>
@@ -35,9 +35,9 @@
 </tspan>
     <tspan x="10px" y="154px"><tspan class="fg-bright-blue bold">29 |</tspan><tspan>                 range: &lt;22, 25&gt;,</tspan>
 </tspan>
-    <tspan x="10px" y="172px"><tspan>   </tspan><tspan class="fg-bright-blue bold">|</tspan><tspan>                         </tspan><tspan class="fg-bright-red bold">^^</tspan><tspan> </tspan><tspan class="fg-bright-red bold">expected struct `annotate_snippets::snippet::Slice`, found reference</tspan>
+    <tspan x="10px" y="172px"><tspan class="fg-bright-blue bold">   |</tspan><tspan class="fg-bright-red bold">                         ^^</tspan><tspan> </tspan><tspan class="fg-bright-red bold">expected struct `annotate_snippets::snippet::Slice`, found reference</tspan>
 </tspan>
-    <tspan x="10px" y="190px"><tspan>   </tspan><tspan class="fg-bright-blue bold">|</tspan>
+    <tspan x="10px" y="190px"><tspan class="fg-bright-blue bold">   |</tspan>
 </tspan>
     <tspan x="10px" y="208px">
 </tspan>
diff --git a/examples/footer.svg b/examples/footer.svg
index 76e7d77..34f81c8 100644
--- a/examples/footer.svg
+++ b/examples/footer.svg
@@ -24,15 +24,15 @@
 </tspan>
     <tspan x="10px" y="46px"><tspan>  </tspan><tspan class="fg-bright-blue bold">--&gt;</tspan><tspan> src/multislice.rs:13:22</tspan>
 </tspan>
-    <tspan x="10px" y="64px"><tspan>   </tspan><tspan class="fg-bright-blue bold">|</tspan>
+    <tspan x="10px" y="64px"><tspan class="fg-bright-blue bold">   |</tspan>
 </tspan>
     <tspan x="10px" y="82px"><tspan class="fg-bright-blue bold">13 |</tspan><tspan>         slices: vec!["A",</tspan>
 </tspan>
-    <tspan x="10px" y="100px"><tspan>   </tspan><tspan class="fg-bright-blue bold">|</tspan><tspan>                      </tspan><tspan class="fg-bright-red bold">^^^</tspan><tspan> </tspan><tspan class="fg-bright-red bold">expected struct `annotate_snippets::snippet::Slice`, found reference</tspan>
+    <tspan x="10px" y="100px"><tspan class="fg-bright-blue bold">   |</tspan><tspan class="fg-bright-red bold">                      ^^^</tspan><tspan> </tspan><tspan class="fg-bright-red bold">expected struct `annotate_snippets::snippet::Slice`, found reference</tspan>
 </tspan>
-    <tspan x="10px" y="118px"><tspan>   </tspan><tspan class="fg-bright-blue bold">|</tspan>
+    <tspan x="10px" y="118px"><tspan class="fg-bright-blue bold">   |</tspan>
 </tspan>
-    <tspan x="10px" y="136px"><tspan>   </tspan><tspan class="fg-bright-blue bold">= </tspan><tspan class="fg-bright-green bold">note</tspan><tspan>: expected type: `snippet::Annotation`</tspan>
+    <tspan x="10px" y="136px"><tspan>   </tspan><tspan class="fg-bright-blue bold">=</tspan><tspan> </tspan><tspan class="fg-bright-green bold">note</tspan><tspan>: expected type: `snippet::Annotation`</tspan>
 </tspan>
     <tspan x="10px" y="154px"><tspan>              found type: `__&amp;__snippet::Annotation`</tspan>
 </tspan>
diff --git a/examples/format.svg b/examples/format.svg
index ac196c0..dd6c1c0 100644
--- a/examples/format.svg
+++ b/examples/format.svg
@@ -1,4 +1,4 @@
-<svg width="740px" height="542px" xmlns="http://www.w3.org/2000/svg">
+<svg width="740px" height="560px" xmlns="http://www.w3.org/2000/svg">
   <style>
     .fg { fill: #AAAAAA }
     .bg { background: #000000 }
@@ -24,59 +24,61 @@
 </tspan>
     <tspan x="10px" y="46px"><tspan>  </tspan><tspan class="fg-bright-blue bold">--&gt;</tspan><tspan> src/format.rs:51:6</tspan>
 </tspan>
-    <tspan x="10px" y="64px"><tspan>   </tspan><tspan class="fg-bright-blue bold">|</tspan>
+    <tspan x="10px" y="64px"><tspan class="fg-bright-blue bold">   |</tspan>
 </tspan>
     <tspan x="10px" y="82px"><tspan class="fg-bright-blue bold">51 |</tspan><tspan>   ) -&gt; Option&lt;String&gt; {</tspan>
 </tspan>
-    <tspan x="10px" y="100px"><tspan>   </tspan><tspan class="fg-bright-blue bold">|</tspan><tspan>        </tspan><tspan class="fg-yellow bold">--------------</tspan><tspan> </tspan><tspan class="fg-yellow bold">expected `Option&lt;String&gt;` because of return type</tspan>
+    <tspan x="10px" y="100px"><tspan class="fg-bright-blue bold">   |</tspan><tspan>  </tspan><tspan class="fg-yellow bold">      --------------</tspan><tspan> </tspan><tspan class="fg-yellow bold">expected `Option&lt;String&gt;` because of return type</tspan>
 </tspan>
-    <tspan x="10px" y="118px"><tspan class="fg-bright-blue bold">52 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">/</tspan><tspan>     for ann in annotations {</tspan>
+    <tspan x="10px" y="118px"><tspan class="fg-bright-blue bold">52 |</tspan><tspan>       for ann in annotations {</tspan>
 </tspan>
-    <tspan x="10px" y="136px"><tspan class="fg-bright-blue bold">53 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>         match (ann.range.0, ann.range.1) {</tspan>
+    <tspan x="10px" y="136px"><tspan class="fg-bright-blue bold">   |</tspan><tspan>  </tspan><tspan class="fg-bright-red bold">_____^</tspan>
 </tspan>
-    <tspan x="10px" y="154px"><tspan class="fg-bright-blue bold">54 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>             (None, None) =&gt; continue,</tspan>
+    <tspan x="10px" y="154px"><tspan class="fg-bright-blue bold">53 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>         match (ann.range.0, ann.range.1) {</tspan>
 </tspan>
-    <tspan x="10px" y="172px"><tspan class="fg-bright-blue bold">55 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>             (Some(start), Some(end)) if start &gt; end_index =&gt; continue,</tspan>
+    <tspan x="10px" y="172px"><tspan class="fg-bright-blue bold">54 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>             (None, None) =&gt; continue,</tspan>
 </tspan>
-    <tspan x="10px" y="190px"><tspan class="fg-bright-blue bold">56 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>             (Some(start), Some(end)) if start &gt;= start_index =&gt; {</tspan>
+    <tspan x="10px" y="190px"><tspan class="fg-bright-blue bold">55 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>             (Some(start), Some(end)) if start &gt; end_index =&gt; continue,</tspan>
 </tspan>
-    <tspan x="10px" y="208px"><tspan class="fg-bright-blue bold">57 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>                 let label = if let Some(ref label) = ann.label {</tspan>
+    <tspan x="10px" y="208px"><tspan class="fg-bright-blue bold">56 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>             (Some(start), Some(end)) if start &gt;= start_index =&gt; {</tspan>
 </tspan>
-    <tspan x="10px" y="226px"><tspan class="fg-bright-blue bold">58 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>                     format!(" {}", label)</tspan>
+    <tspan x="10px" y="226px"><tspan class="fg-bright-blue bold">57 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>                 let label = if let Some(ref label) = ann.label {</tspan>
 </tspan>
-    <tspan x="10px" y="244px"><tspan class="fg-bright-blue bold">59 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>                 } else {</tspan>
+    <tspan x="10px" y="244px"><tspan class="fg-bright-blue bold">58 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>                     format!(" {}", label)</tspan>
 </tspan>
-    <tspan x="10px" y="262px"><tspan class="fg-bright-blue bold">60 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>                     String::from("")</tspan>
+    <tspan x="10px" y="262px"><tspan class="fg-bright-blue bold">59 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>                 } else {</tspan>
 </tspan>
-    <tspan x="10px" y="280px"><tspan class="fg-bright-blue bold">61 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>                 };</tspan>
+    <tspan x="10px" y="280px"><tspan class="fg-bright-blue bold">60 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>                     String::from("")</tspan>
 </tspan>
-    <tspan x="10px" y="298px"><tspan class="fg-bright-blue bold">62 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan>
+    <tspan x="10px" y="298px"><tspan class="fg-bright-blue bold">61 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>                 };</tspan>
 </tspan>
-    <tspan x="10px" y="316px"><tspan class="fg-bright-blue bold">63 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>                 return Some(format!(</tspan>
+    <tspan x="10px" y="316px"><tspan class="fg-bright-blue bold">62 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan> </tspan>
 </tspan>
-    <tspan x="10px" y="334px"><tspan class="fg-bright-blue bold">64 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>                     "{}{}{}",</tspan>
+    <tspan x="10px" y="334px"><tspan class="fg-bright-blue bold">63 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>                 return Some(format!(</tspan>
 </tspan>
-    <tspan x="10px" y="352px"><tspan class="fg-bright-blue bold">65 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>                     " ".repeat(start - start_index),</tspan>
+    <tspan x="10px" y="352px"><tspan class="fg-bright-blue bold">64 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>                     "{}{}{}",</tspan>
 </tspan>
-    <tspan x="10px" y="370px"><tspan class="fg-bright-blue bold">66 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>                     "^".repeat(end - start),</tspan>
+    <tspan x="10px" y="370px"><tspan class="fg-bright-blue bold">65 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>                     " ".repeat(start - start_index),</tspan>
 </tspan>
-    <tspan x="10px" y="388px"><tspan class="fg-bright-blue bold">67 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>                     label</tspan>
+    <tspan x="10px" y="388px"><tspan class="fg-bright-blue bold">66 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>                     "^".repeat(end - start),</tspan>
 </tspan>
-    <tspan x="10px" y="406px"><tspan class="fg-bright-blue bold">68 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>                 ));</tspan>
+    <tspan x="10px" y="406px"><tspan class="fg-bright-blue bold">67 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>                     label</tspan>
 </tspan>
-    <tspan x="10px" y="424px"><tspan class="fg-bright-blue bold">69 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>             }</tspan>
+    <tspan x="10px" y="424px"><tspan class="fg-bright-blue bold">68 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>                 ));</tspan>
 </tspan>
-    <tspan x="10px" y="442px"><tspan class="fg-bright-blue bold">70 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>             _ =&gt; continue,</tspan>
+    <tspan x="10px" y="442px"><tspan class="fg-bright-blue bold">69 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>             }</tspan>
 </tspan>
-    <tspan x="10px" y="460px"><tspan class="fg-bright-blue bold">71 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>         }</tspan>
+    <tspan x="10px" y="460px"><tspan class="fg-bright-blue bold">70 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>             _ =&gt; continue,</tspan>
 </tspan>
-    <tspan x="10px" y="478px"><tspan class="fg-bright-blue bold">72 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>     }</tspan>
+    <tspan x="10px" y="478px"><tspan class="fg-bright-blue bold">71 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>         }</tspan>
 </tspan>
-    <tspan x="10px" y="496px"><tspan>   </tspan><tspan class="fg-bright-blue bold">|</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|____^</tspan><tspan> </tspan><tspan class="fg-bright-red bold">expected enum `std::option::Option`</tspan>
+    <tspan x="10px" y="496px"><tspan class="fg-bright-blue bold">72 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>     }</tspan>
 </tspan>
-    <tspan x="10px" y="514px"><tspan>   </tspan><tspan class="fg-bright-blue bold">|</tspan>
+    <tspan x="10px" y="514px"><tspan class="fg-bright-blue bold">   |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan class="fg-bright-red bold">____^</tspan><tspan> </tspan><tspan class="fg-bright-red bold">expected enum `std::option::Option`</tspan>
 </tspan>
-    <tspan x="10px" y="532px">
+    <tspan x="10px" y="532px"><tspan class="fg-bright-blue bold">   |</tspan>
+</tspan>
+    <tspan x="10px" y="550px">
 </tspan>
   </text>
 
diff --git a/examples/multislice.svg b/examples/multislice.svg
index 216a359..2ab959a 100644
--- a/examples/multislice.svg
+++ b/examples/multislice.svg
@@ -23,19 +23,19 @@
 </tspan>
     <tspan x="10px" y="46px"><tspan>   </tspan><tspan class="fg-bright-blue bold">--&gt;</tspan><tspan> src/format.rs</tspan>
 </tspan>
-    <tspan x="10px" y="64px"><tspan>    </tspan><tspan class="fg-bright-blue bold">|</tspan>
+    <tspan x="10px" y="64px"><tspan class="fg-bright-blue bold">    |</tspan>
 </tspan>
     <tspan x="10px" y="82px"><tspan class="fg-bright-blue bold"> 51 |</tspan><tspan> Foo</tspan>
 </tspan>
-    <tspan x="10px" y="100px"><tspan>    </tspan><tspan class="fg-bright-blue bold">|</tspan>
+    <tspan x="10px" y="100px"><tspan class="fg-bright-blue bold">    |</tspan>
 </tspan>
     <tspan x="10px" y="118px"><tspan>   </tspan><tspan class="fg-bright-blue bold">:::</tspan><tspan> src/display.rs</tspan>
 </tspan>
-    <tspan x="10px" y="136px"><tspan>    </tspan><tspan class="fg-bright-blue bold">|</tspan>
+    <tspan x="10px" y="136px"><tspan class="fg-bright-blue bold">    |</tspan>
 </tspan>
     <tspan x="10px" y="154px"><tspan class="fg-bright-blue bold">129 |</tspan><tspan> Faa</tspan>
 </tspan>
-    <tspan x="10px" y="172px"><tspan>    </tspan><tspan class="fg-bright-blue bold">|</tspan>
+    <tspan x="10px" y="172px"><tspan class="fg-bright-blue bold">    |</tspan>
 </tspan>
     <tspan x="10px" y="190px">
 </tspan>
diff --git a/src/renderer/display_list.rs b/src/renderer/display_list.rs
index eea4971..b5fef26 100644
--- a/src/renderer/display_list.rs
+++ b/src/renderer/display_list.rs
@@ -32,13 +32,11 @@
 //!
 //! The above snippet has been built out of the following structure:
 use crate::snippet;
-use std::cmp::{max, min, Reverse};
-use std::collections::HashMap;
-use std::fmt::Display;
+use std::cmp::{max, min};
+use std::fmt::{Display, Write};
 use std::ops::Range;
 use std::{cmp, fmt};
 
-use crate::renderer::styled_buffer::StyledBuffer;
 use crate::renderer::{stylesheet::Stylesheet, Margin, Style, DEFAULT_TERM_WIDTH};
 
 const ANONYMIZED_LINE_NUM: &str = "LL";
@@ -85,31 +83,19 @@ impl<'a> Display for DisplayList<'a> {
         } else {
             ((lineno_width as f64).log10().floor() as usize) + 1
         };
-
-        let multiline_depth = self.body.iter().fold(0, |max, set| {
-            set.display_lines.iter().fold(max, |max2, line| match line {
-                DisplayLine::Source { annotations, .. } => cmp::max(
-                    annotations.iter().fold(max2, |max3, line| {
-                        cmp::max(
-                            match line.annotation_part {
-                                DisplayAnnotationPart::Standalone => 0,
-                                DisplayAnnotationPart::LabelContinuation => 0,
-                                DisplayAnnotationPart::MultilineStart(depth) => depth + 1,
-                                DisplayAnnotationPart::MultilineEnd(depth) => depth + 1,
-                            },
-                            max3,
-                        )
-                    }),
-                    max,
-                ),
-                _ => max2,
+        let inline_marks_width = self.body.iter().fold(0, |max, set| {
+            set.display_lines.iter().fold(max, |max, line| match line {
+                DisplayLine::Source { inline_marks, .. } => cmp::max(inline_marks.len(), max),
+                _ => max,
             })
         });
-        let mut buffer = StyledBuffer::new();
+
+        let mut count_offset = 0;
         for set in self.body.iter() {
-            self.format_set(set, lineno_width, multiline_depth, &mut buffer)?;
+            self.format_set(set, lineno_width, inline_marks_width, count_offset, f)?;
+            count_offset += set.display_lines.len();
         }
-        write!(f, "{}", buffer.render(self.stylesheet)?)
+        Ok(())
     }
 }
 
@@ -133,18 +119,27 @@ impl<'a> DisplayList<'a> {
         &self,
         set: &DisplaySet<'_>,
         lineno_width: usize,
-        multiline_depth: usize,
-        buffer: &mut StyledBuffer,
+        inline_marks_width: usize,
+        count_offset: usize,
+        f: &mut fmt::Formatter<'_>,
     ) -> fmt::Result {
-        for line in &set.display_lines {
+        let body_len = self
+            .body
+            .iter()
+            .map(|set| set.display_lines.len())
+            .sum::<usize>();
+        for (i, line) in set.display_lines.iter().enumerate() {
             set.format_line(
                 line,
                 lineno_width,
-                multiline_depth,
+                inline_marks_width,
                 self.stylesheet,
                 self.anonymized_line_numbers,
-                buffer,
+                f,
             )?;
+            if i + count_offset + 1 < body_len {
+                f.write_char('\n')?;
+            }
         }
         Ok(())
     }
@@ -159,27 +154,36 @@ pub(crate) struct DisplaySet<'a> {
 impl<'a> DisplaySet<'a> {
     fn format_label(
         &self,
-        line_offset: usize,
         label: &[DisplayTextFragment<'_>],
         stylesheet: &Stylesheet,
-        buffer: &mut StyledBuffer,
+        f: &mut fmt::Formatter<'_>,
     ) -> fmt::Result {
+        let emphasis_style = stylesheet.emphasis();
+
         for fragment in label {
-            let style = match fragment.style {
-                DisplayTextStyle::Regular => stylesheet.none(),
-                DisplayTextStyle::Emphasis => stylesheet.emphasis(),
-            };
-            buffer.append(line_offset, fragment.content, *style);
+            match fragment.style {
+                DisplayTextStyle::Regular => fragment.content.fmt(f)?,
+                DisplayTextStyle::Emphasis => {
+                    write!(
+                        f,
+                        "{}{}{}",
+                        emphasis_style.render(),
+                        fragment.content,
+                        emphasis_style.render_reset()
+                    )?;
+                }
+            }
         }
         Ok(())
     }
+
     fn format_annotation(
         &self,
-        line_offset: usize,
         annotation: &Annotation<'_>,
         continuation: bool,
+        in_source: bool,
         stylesheet: &Stylesheet,
-        buffer: &mut StyledBuffer,
+        f: &mut fmt::Formatter<'_>,
     ) -> fmt::Result {
         let color = get_annotation_style(&annotation.annotation_type, stylesheet);
         let formatted_len = if let Some(id) = &annotation.id {
@@ -189,27 +193,31 @@ impl<'a> DisplaySet<'a> {
         };
 
         if continuation {
-            for _ in 0..formatted_len + 2 {
-                buffer.append(line_offset, " ", Style::new());
-            }
-            return self.format_label(line_offset, &annotation.label, stylesheet, buffer);
+            format_repeat_char(' ', formatted_len + 2, f)?;
+            return self.format_label(&annotation.label, stylesheet, f);
         }
         if formatted_len == 0 {
-            self.format_label(line_offset, &annotation.label, stylesheet, buffer)
+            self.format_label(&annotation.label, stylesheet, f)
         } else {
-            let id = match &annotation.id {
-                Some(id) => format!("[{}]", id),
-                None => String::new(),
-            };
-            buffer.append(
-                line_offset,
-                &format!("{}{}", annotation_type_str(&annotation.annotation_type), id),
-                *color,
-            );
+            write!(f, "{}", color.render())?;
+            format_annotation_type(&annotation.annotation_type, f)?;
+            if let Some(id) = &annotation.id {
+                f.write_char('[')?;
+                f.write_str(id)?;
+                f.write_char(']')?;
+            }
+            write!(f, "{}", color.render_reset())?;
 
             if !is_annotation_empty(annotation) {
-                buffer.append(line_offset, ": ", stylesheet.none);
-                self.format_label(line_offset, &annotation.label, stylesheet, buffer)?;
+                if in_source {
+                    write!(f, "{}", color.render())?;
+                    f.write_str(": ")?;
+                    self.format_label(&annotation.label, stylesheet, f)?;
+                    write!(f, "{}", color.render_reset())?;
+                } else {
+                    f.write_str(": ")?;
+                    self.format_label(&annotation.label, stylesheet, f)?;
+                }
             }
             Ok(())
         }
@@ -218,11 +226,10 @@ impl<'a> DisplaySet<'a> {
     #[inline]
     fn format_raw_line(
         &self,
-        line_offset: usize,
         line: &DisplayRawLine<'_>,
         lineno_width: usize,
         stylesheet: &Stylesheet,
-        buffer: &mut StyledBuffer,
+        f: &mut fmt::Formatter<'_>,
     ) -> fmt::Result {
         match line {
             DisplayRawLine::Origin {
@@ -235,15 +242,34 @@ impl<'a> DisplaySet<'a> {
                     DisplayHeaderType::Continuation => ":::",
                 };
                 let lineno_color = stylesheet.line_no();
-                buffer.puts(line_offset, lineno_width, header_sigil, *lineno_color);
-                buffer.puts(line_offset, lineno_width + 4, path, stylesheet.none);
+
                 if let Some((col, row)) = pos {
-                    buffer.append(line_offset, ":", stylesheet.none);
-                    buffer.append(line_offset, col.to_string().as_str(), stylesheet.none);
-                    buffer.append(line_offset, ":", stylesheet.none);
-                    buffer.append(line_offset, row.to_string().as_str(), stylesheet.none);
+                    format_repeat_char(' ', lineno_width, f)?;
+                    write!(
+                        f,
+                        "{}{}{}",
+                        lineno_color.render(),
+                        header_sigil,
+                        lineno_color.render_reset()
+                    )?;
+                    f.write_char(' ')?;
+                    path.fmt(f)?;
+                    f.write_char(':')?;
+                    col.fmt(f)?;
+                    f.write_char(':')?;
+                    row.fmt(f)
+                } else {
+                    format_repeat_char(' ', lineno_width, f)?;
+                    write!(
+                        f,
+                        "{}{}{}",
+                        lineno_color.render(),
+                        header_sigil,
+                        lineno_color.render_reset()
+                    )?;
+                    f.write_char(' ')?;
+                    path.fmt(f)
                 }
-                Ok(())
             }
             DisplayRawLine::Annotation {
                 annotation,
@@ -252,35 +278,35 @@ impl<'a> DisplaySet<'a> {
             } => {
                 if *source_aligned {
                     if *continuation {
-                        for _ in 0..lineno_width + 3 {
-                            buffer.append(line_offset, " ", stylesheet.none);
-                        }
+                        format_repeat_char(' ', lineno_width + 3, f)?;
                     } else {
                         let lineno_color = stylesheet.line_no();
-                        for _ in 0..lineno_width + 1 {
-                            buffer.append(line_offset, " ", stylesheet.none);
-                        }
-                        buffer.append(line_offset, "=", *lineno_color);
-                        buffer.append(line_offset, " ", *lineno_color);
+                        format_repeat_char(' ', lineno_width, f)?;
+                        f.write_char(' ')?;
+                        write!(
+                            f,
+                            "{}={}",
+                            lineno_color.render(),
+                            lineno_color.render_reset()
+                        )?;
+                        f.write_char(' ')?;
                     }
                 }
-                self.format_annotation(line_offset, annotation, *continuation, stylesheet, buffer)
+                self.format_annotation(annotation, *continuation, false, stylesheet, f)
             }
         }
     }
 
-    // Adapted from https://github.com/rust-lang/rust/blob/d371d17496f2ce3a56da76aa083f4ef157572c20/compiler/rustc_errors/src/emitter.rs#L706-L1211
     #[inline]
     fn format_line(
         &self,
         dl: &DisplayLine<'_>,
         lineno_width: usize,
-        multiline_depth: usize,
+        inline_marks_width: usize,
         stylesheet: &Stylesheet,
         anonymized_line_numbers: bool,
-        buffer: &mut StyledBuffer,
+        f: &mut fmt::Formatter<'_>,
     ) -> fmt::Result {
-        let line_offset = buffer.num_lines();
         match dl {
             DisplayLine::Source {
                 lineno,
@@ -290,45 +316,36 @@ impl<'a> DisplaySet<'a> {
             } => {
                 let lineno_color = stylesheet.line_no();
                 if anonymized_line_numbers && lineno.is_some() {
-                    let num = format!("{:>width$} |", ANONYMIZED_LINE_NUM, width = lineno_width);
-                    buffer.puts(line_offset, 0, &num, *lineno_color);
+                    write!(f, "{}", lineno_color.render())?;
+                    f.write_str(ANONYMIZED_LINE_NUM)?;
+                    f.write_str(" |")?;
+                    write!(f, "{}", lineno_color.render_reset())?;
                 } else {
+                    write!(f, "{}", lineno_color.render())?;
                     match lineno {
-                        Some(n) => {
-                            let num = format!("{:>width$} |", n, width = lineno_width);
-                            buffer.puts(line_offset, 0, &num, *lineno_color);
-                        }
-                        None => {
-                            buffer.putc(line_offset, lineno_width + 1, '|', *lineno_color);
-                        }
-                    };
+                        Some(n) => write!(f, "{:>width$}", n, width = lineno_width),
+                        None => format_repeat_char(' ', lineno_width, f),
+                    }?;
+                    f.write_str(" |")?;
+                    write!(f, "{}", lineno_color.render_reset())?;
                 }
-                if let DisplaySourceLine::Content { text, .. } = line {
-                    // The width of the line number, a space, pipe, and a space
-                    // `123 | ` is `lineno_width + 3`.
-                    let width_offset = lineno_width + 3;
-                    let code_offset = if multiline_depth == 0 {
-                        width_offset
-                    } else {
-                        width_offset + multiline_depth + 1
-                    };
 
-                    // Add any inline marks to the code line
-                    if !inline_marks.is_empty() || 0 < multiline_depth {
-                        format_inline_marks(
-                            line_offset,
-                            inline_marks,
-                            lineno_width,
-                            stylesheet,
-                            buffer,
-                        )?;
+                if let DisplaySourceLine::Content { text, .. } = line {
+                    if !inline_marks.is_empty() || 0 < inline_marks_width {
+                        f.write_char(' ')?;
+                        self.format_inline_marks(inline_marks, inline_marks_width, stylesheet, f)?;
                     }
+                    f.write_char(' ')?;
 
                     let text = normalize_whitespace(text);
                     let line_len = text.as_bytes().len();
-                    let left = self.margin.left(line_len);
+                    let mut left = self.margin.left(line_len);
                     let right = self.margin.right(line_len);
 
+                    if self.margin.was_cut_left() {
+                        "...".fmt(f)?;
+                        left += 3;
+                    }
                     // On long lines, we strip the source line, accounting for unicode.
                     let mut taken = 0;
                     let code: String = text
@@ -347,405 +364,135 @@ impl<'a> DisplaySet<'a> {
                             true
                         })
                         .collect();
-                    buffer.puts(line_offset, code_offset, &code, Style::new());
-                    if self.margin.was_cut_left() {
-                        // We have stripped some code/whitespace from the beginning, make it clear.
-                        buffer.puts(line_offset, code_offset, "...", *lineno_color);
-                    }
+
                     if self.margin.was_cut_right(line_len) {
-                        buffer.puts(line_offset, code_offset + taken - 3, "...", *lineno_color);
+                        code[..taken.saturating_sub(3)].fmt(f)?;
+                        "...".fmt(f)?;
+                    } else {
+                        code.fmt(f)?;
                     }
 
-                    let left: usize = text
+                    let mut left: usize = text
                         .chars()
                         .take(left)
                         .map(|ch| unicode_width::UnicodeWidthChar::width(ch).unwrap_or(1))
                         .sum();
 
-                    let mut annotations = annotations.clone();
-                    annotations.sort_by_key(|a| Reverse(a.range.0));
-
-                    let mut annotations_positions = vec![];
-                    let mut line_len: usize = 0;
-                    let mut p = 0;
-                    for (i, annotation) in annotations.iter().enumerate() {
-                        for (j, next) in annotations.iter().enumerate() {
-                            // This label overlaps with another one and both take space (
-                            // they have text and are not multiline lines).
-                            if overlaps(next, annotation, 0)
-                                && annotation.has_label()
-                                && j > i
-                                && p == 0
-                            // We're currently on the first line, move the label one line down
-                            {
-                                // If we're overlapping with an un-labelled annotation with the same span
-                                // we can just merge them in the output
-                                if next.range.0 == annotation.range.0
-                                    && next.range.1 == annotation.range.1
-                                    && !next.has_label()
-                                {
-                                    continue;
-                                }
-
-                                // This annotation needs a new line in the output.
-                                p += 1;
-                                break;
-                            }
-                        }
-                        annotations_positions.push((p, annotation));
-                        for (j, next) in annotations.iter().enumerate() {
-                            if j > i {
-                                let l = next
-                                    .annotation
-                                    .label
-                                    .iter()
-                                    .map(|label| label.content)
-                                    .collect::<Vec<_>>()
-                                    .join("")
-                                    .len()
-                                    + 2;
-                                // Do not allow two labels to be in the same line if they
-                                // overlap including padding, to avoid situations like:
-                                //
-                                // fn foo(x: u32) {
-                                // -------^------
-                                // |      |
-                                // fn_spanx_span
-                                //
-                                // Both labels must have some text, otherwise they are not
-                                // overlapping. Do not add a new line if this annotation or
-                                // the next are vertical line placeholders. If either this
-                                // or the next annotation is multiline start/end, move it
-                                // to a new line so as not to overlap the horizontal lines.
-                                if (overlaps(next, annotation, l)
-                                    && annotation.has_label()
-                                    && next.has_label())
-                                    || (annotation.takes_space() && next.has_label())
-                                    || (annotation.has_label() && next.takes_space())
-                                    || (annotation.takes_space() && next.takes_space())
-                                    || (overlaps(next, annotation, l)
-                                        && next.range.1 <= annotation.range.1
-                                        && next.has_label()
-                                        && p == 0)
-                                // Avoid #42595.
-                                {
-                                    // This annotation needs a new line in the output.
-                                    p += 1;
-                                    break;
-                                }
-                            }
-                        }
-                        line_len = max(line_len, p);
-                    }
-
-                    if line_len != 0 {
-                        line_len += 1;
-                    }
-
-                    if annotations_positions.iter().all(|(_, ann)| {
-                        matches!(
-                            ann.annotation_part,
-                            DisplayAnnotationPart::MultilineStart(_)
-                        )
-                    }) {
-                        if let Some(max_pos) =
-                            annotations_positions.iter().map(|(pos, _)| *pos).max()
-                        {
-                            // Special case the following, so that we minimize overlapping multiline spans.
-                            //
-                            // 3 │       X0 Y0 Z0
-                            //   │ ┏━━━━━┛  │  │     < We are writing these lines
-                            //   │ ┃┌───────┘  │     < by reverting the "depth" of
-                            //   │ ┃│┌─────────┘     < their multilne spans.
-                            // 4 │ ┃││   X1 Y1 Z1
-                            // 5 │ ┃││   X2 Y2 Z2
-                            //   │ ┃│└────╿──│──┘ `Z` label
-                            //   │ ┃└─────│──┤
-                            //   │ ┗━━━━━━┥  `Y` is a good letter too
-                            //   ╰╴       `X` is a good letter
-                            for (pos, _) in &mut annotations_positions {
-                                *pos = max_pos - *pos;
-                            }
-                            // We know then that we don't need an additional line for the span label, saving us
-                            // one line of vertical space.
-                            line_len = line_len.saturating_sub(1);
-                        }
-                    }
-
-                    // This is a special case where we have a multiline
-                    // annotation that is at the start of the line disregarding
-                    // any leading whitespace, and no other multiline
-                    // annotations overlap it. In this case, we want to draw
-                    //
-                    // 2 |   fn foo() {
-                    //   |  _^
-                    // 3 | |
-                    // 4 | | }
-                    //   | |_^ test
-                    //
-                    // we simplify the output to:
-                    //
-                    // 2 | / fn foo() {
-                    // 3 | |
-                    // 4 | | }
-                    //   | |_^ test
-                    if multiline_depth == 1
-                        && annotations_positions.len() == 1
-                        && annotations_positions
-                            .first()
-                            .map_or(false, |(_, annotation)| {
-                                matches!(
-                                    annotation.annotation_part,
-                                    DisplayAnnotationPart::MultilineStart(_)
-                                ) && text
-                                    .chars()
-                                    .take(annotation.range.0)
-                                    .all(|c| c.is_whitespace())
-                            })
-                    {
-                        let (_, ann) = annotations_positions.remove(0);
-                        let style = get_annotation_style(&ann.annotation_type, stylesheet);
-                        buffer.putc(line_offset, 3 + lineno_width, '/', *style);
-                    }
-
-                    // Draw the column separator for any extra lines that were
-                    // created
-                    //
-                    // After this we will have:
-                    //
-                    // 2 |   fn foo() {
-                    //   |
-                    //   |
-                    //   |
-                    // 3 |
-                    // 4 |   }
-                    //   |
-                    if !annotations_positions.is_empty() {
-                        for pos in 0..=line_len {
-                            buffer.putc(
-                                line_offset + pos + 1,
-                                lineno_width + 1,
-                                '|',
-                                stylesheet.line_no,
-                            );
-                        }
-                    }
-
-                    // Write the horizontal lines for multiline annotations
-                    // (only the first and last lines need this).
-                    //
-                    // After this we will have:
-                    //
-                    // 2 |   fn foo() {
-                    //   |  __________
-                    //   |
-                    //   |
-                    // 3 |
-                    // 4 |   }
-                    //   |  _
-                    for &(pos, annotation) in &annotations_positions {
-                        let style = get_annotation_style(&annotation.annotation_type, stylesheet);
-                        let pos = pos + 1;
-                        match annotation.annotation_part {
-                            DisplayAnnotationPart::MultilineStart(depth)
-                            | DisplayAnnotationPart::MultilineEnd(depth) => {
-                                for col in width_offset + depth
-                                    ..(code_offset + annotation.range.0).saturating_sub(left)
-                                {
-                                    buffer.putc(line_offset + pos, col + 1, '_', *style);
-                                }
-                            }
-                            _ => {}
-                        }
-                    }
-
-                    // Write the vertical lines for labels that are on a different line as the underline.
-                    //
-                    // After this we will have:
-                    //
-                    // 2 |   fn foo() {
-                    //   |  __________
-                    //   | |    |
-                    //   | |
-                    // 3 | |
-                    // 4 | | }
-                    //   | |_
-                    for &(pos, annotation) in &annotations_positions {
-                        let style = get_annotation_style(&annotation.annotation_type, stylesheet);
-                        let pos = pos + 1;
-                        if pos > 1 && (annotation.has_label() || annotation.takes_space()) {
-                            for p in line_offset + 2..=line_offset + pos {
-                                buffer.putc(
-                                    p,
-                                    (code_offset + annotation.range.0).saturating_sub(left),
-                                    '|',
-                                    *style,
-                                );
-                            }
-                        }
-                        match annotation.annotation_part {
-                            DisplayAnnotationPart::MultilineStart(depth) => {
-                                for p in line_offset + pos + 1..line_offset + line_len + 2 {
-                                    buffer.putc(p, width_offset + depth, '|', *style);
-                                }
-                            }
-                            DisplayAnnotationPart::MultilineEnd(depth) => {
-                                for p in line_offset..=line_offset + pos {
-                                    buffer.putc(p, width_offset + depth, '|', *style);
-                                }
-                            }
-                            _ => {}
-                        }
-                    }
-
-                    // Add in any inline marks for any extra lines that have
-                    // been created. Output should look like above.
-                    for inline_mark in inline_marks {
-                        let DisplayMarkType::AnnotationThrough(depth) = inline_mark.mark_type;
-                        let style = get_annotation_style(&inline_mark.annotation_type, stylesheet);
-                        if annotations_positions.is_empty() {
-                            buffer.putc(line_offset, width_offset + depth, '|', *style);
-                        } else {
-                            for p in line_offset..=line_offset + line_len + 1 {
-                                buffer.putc(p, width_offset + depth, '|', *style);
-                            }
-                        }
-                    }
-
-                    // Write the labels on the annotations that actually have a label.
-                    //
-                    // After this we will have:
-                    //
-                    // 2 |   fn foo() {
-                    //   |  __________
-                    //   |      |
-                    //   |      something about `foo`
-                    // 3 |
-                    // 4 |   }
-                    //   |  _  test
-                    for &(pos, annotation) in &annotations_positions {
-                        if !is_annotation_empty(&annotation.annotation) {
-                            let style =
-                                get_annotation_style(&annotation.annotation_type, stylesheet);
-                            let mut formatted_len = if let Some(id) = &annotation.annotation.id {
-                                2 + id.len()
-                                    + annotation_type_len(&annotation.annotation.annotation_type)
-                            } else {
-                                annotation_type_len(&annotation.annotation.annotation_type)
-                            };
-                            let (pos, col) = if pos == 0 {
-                                (pos + 1, (annotation.range.1 + 1).saturating_sub(left))
-                            } else {
-                                (pos + 2, annotation.range.0.saturating_sub(left))
-                            };
-                            if annotation.annotation_part
-                                == DisplayAnnotationPart::LabelContinuation
-                            {
-                                formatted_len = 0;
-                            } else if formatted_len != 0 {
-                                formatted_len += 2;
-                                let id = match &annotation.annotation.id {
-                                    Some(id) => format!("[{}]", id),
-                                    None => String::new(),
-                                };
-                                buffer.puts(
-                                    line_offset + pos,
-                                    col + code_offset,
-                                    &format!(
-                                        "{}{}: ",
-                                        annotation_type_str(&annotation.annotation_type),
-                                        id
-                                    ),
-                                    *style,
-                                );
-                            } else {
-                                formatted_len = 0;
-                            }
-                            let mut before = 0;
-                            for fragment in &annotation.annotation.label {
-                                let inner_col = before + formatted_len + col + code_offset;
-                                buffer.puts(line_offset + pos, inner_col, fragment.content, *style);
-                                before += fragment.content.len();
-                            }
-                        }
+                    if self.margin.was_cut_left() {
+                        left = left.saturating_sub(3);
                     }
 
-                    // Sort from biggest span to smallest span so that smaller spans are
-                    // represented in the output:
-                    //
-                    // x | fn foo()
-                    //   | ^^^---^^
-                    //   | |  |
-                    //   | |  something about `foo`
-                    //   | something about `fn foo()`
-                    annotations_positions.sort_by_key(|(_, ann)| {
-                        // Decreasing order. When annotations share the same length, prefer `Primary`.
-                        Reverse(ann.len())
-                    });
-
-                    // Write the underlines.
-                    //
-                    // After this we will have:
-                    //
-                    // 2 |   fn foo() {
-                    //   |  ____-_____^
-                    //   |      |
-                    //   |      something about `foo`
-                    // 3 |
-                    // 4 |   }
-                    //   |  _^  test
-                    for &(_, annotation) in &annotations_positions {
-                        let mark = match annotation.annotation_type {
-                            DisplayAnnotationType::Error => '^',
-                            DisplayAnnotationType::Warning => '-',
-                            DisplayAnnotationType::Info => '-',
-                            DisplayAnnotationType::Note => '-',
-                            DisplayAnnotationType::Help => '-',
-                            DisplayAnnotationType::None => ' ',
-                        };
-                        let style = get_annotation_style(&annotation.annotation_type, stylesheet);
-                        for p in annotation.range.0..annotation.range.1 {
-                            buffer.putc(
-                                line_offset + 1,
-                                (code_offset + p).saturating_sub(left),
-                                mark,
-                                *style,
-                            );
+                    for annotation in annotations {
+                        // Each annotation should be on its own line
+                        f.write_char('\n')?;
+                        // Add the line number and the line number delimiter
+                        write!(f, "{}", stylesheet.line_no.render())?;
+                        format_repeat_char(' ', lineno_width, f)?;
+                        f.write_str(" |")?;
+                        write!(f, "{}", stylesheet.line_no.render_reset())?;
+
+                        if !inline_marks.is_empty() || 0 < inline_marks_width {
+                            f.write_char(' ')?;
+                            self.format_inline_marks(
+                                inline_marks,
+                                inline_marks_width,
+                                stylesheet,
+                                f,
+                            )?;
                         }
+                        self.format_source_annotation(annotation, left, stylesheet, f)?;
                     }
                 } else if !inline_marks.is_empty() {
-                    format_inline_marks(
-                        line_offset,
-                        inline_marks,
-                        lineno_width,
-                        stylesheet,
-                        buffer,
-                    )?;
+                    f.write_char(' ')?;
+                    self.format_inline_marks(inline_marks, inline_marks_width, stylesheet, f)?;
                 }
                 Ok(())
             }
             DisplayLine::Fold { inline_marks } => {
-                buffer.puts(line_offset, 0, "...", *stylesheet.line_no());
-                if !inline_marks.is_empty() || 0 < multiline_depth {
-                    format_inline_marks(
-                        line_offset,
-                        inline_marks,
-                        lineno_width,
-                        stylesheet,
-                        buffer,
-                    )?;
+                f.write_str("...")?;
+                if !inline_marks.is_empty() || 0 < inline_marks_width {
+                    format_repeat_char(' ', lineno_width, f)?;
+                    self.format_inline_marks(inline_marks, inline_marks_width, stylesheet, f)?;
                 }
                 Ok(())
             }
-            DisplayLine::Raw(line) => {
-                self.format_raw_line(line_offset, line, lineno_width, stylesheet, buffer)
-            }
+            DisplayLine::Raw(line) => self.format_raw_line(line, lineno_width, stylesheet, f),
+        }
+    }
+
+    fn format_inline_marks(
+        &self,
+        inline_marks: &[DisplayMark],
+        inline_marks_width: usize,
+        stylesheet: &Stylesheet,
+        f: &mut fmt::Formatter<'_>,
+    ) -> fmt::Result {
+        format_repeat_char(' ', inline_marks_width - inline_marks.len(), f)?;
+        for mark in inline_marks {
+            let annotation_style = get_annotation_style(&mark.annotation_type, stylesheet);
+            write!(f, "{}", annotation_style.render())?;
+            f.write_char(match mark.mark_type {
+                DisplayMarkType::AnnotationThrough => '|',
+                DisplayMarkType::AnnotationStart => '/',
+            })?;
+            write!(f, "{}", annotation_style.render_reset())?;
         }
+        Ok(())
+    }
+
+    fn format_source_annotation(
+        &self,
+        annotation: &DisplaySourceAnnotation<'_>,
+        left: usize,
+        stylesheet: &Stylesheet,
+        f: &mut fmt::Formatter<'_>,
+    ) -> fmt::Result {
+        let indent_char = match annotation.annotation_part {
+            DisplayAnnotationPart::Standalone => ' ',
+            DisplayAnnotationPart::LabelContinuation => ' ',
+            DisplayAnnotationPart::MultilineStart => '_',
+            DisplayAnnotationPart::MultilineEnd => '_',
+        };
+        let mark = match annotation.annotation_type {
+            DisplayAnnotationType::Error => '^',
+            DisplayAnnotationType::Warning => '-',
+            DisplayAnnotationType::Info => '-',
+            DisplayAnnotationType::Note => '-',
+            DisplayAnnotationType::Help => '-',
+            DisplayAnnotationType::None => ' ',
+        };
+        let color = get_annotation_style(&annotation.annotation_type, stylesheet);
+        let range = (
+            annotation.range.0.saturating_sub(left),
+            annotation.range.1.saturating_sub(left),
+        );
+        let indent_length = match annotation.annotation_part {
+            DisplayAnnotationPart::LabelContinuation => range.1,
+            _ => range.0,
+        };
+        write!(f, "{}", color.render())?;
+        format_repeat_char(indent_char, indent_length + 1, f)?;
+        format_repeat_char(mark, range.1 - indent_length, f)?;
+        write!(f, "{}", color.render_reset())?;
+
+        if !is_annotation_empty(&annotation.annotation) {
+            f.write_char(' ')?;
+            write!(f, "{}", color.render())?;
+            self.format_annotation(
+                &annotation.annotation,
+                annotation.annotation_part == DisplayAnnotationPart::LabelContinuation,
+                true,
+                stylesheet,
+                f,
+            )?;
+            write!(f, "{}", color.render_reset())?;
+        }
+        Ok(())
     }
 }
 
 /// Inline annotation which can be used in either Raw or Source line.
-#[derive(Clone, Debug, PartialEq)]
+#[derive(Debug, PartialEq)]
 pub(crate) struct Annotation<'a> {
     pub(crate) annotation_type: DisplayAnnotationType,
     pub(crate) id: Option<&'a str>,
@@ -777,13 +524,12 @@ pub(crate) enum DisplaySourceLine<'a> {
     Content {
         text: &'a str,
         range: (usize, usize), // meta information for annotation placement.
-        end_line: EndLine,
     },
     /// An empty source line.
     Empty,
 }
 
-#[derive(Clone, Debug, PartialEq)]
+#[derive(Debug, PartialEq)]
 pub(crate) struct DisplaySourceAnnotation<'a> {
     pub(crate) annotation: Annotation<'a>,
     pub(crate) range: (usize, usize),
@@ -791,34 +537,6 @@ pub(crate) struct DisplaySourceAnnotation<'a> {
     pub(crate) annotation_part: DisplayAnnotationPart,
 }
 
-impl<'a> DisplaySourceAnnotation<'a> {
-    fn has_label(&self) -> bool {
-        !self
-            .annotation
-            .label
-            .iter()
-            .all(|label| label.content.is_empty())
-    }
-
-    // Length of this annotation as displayed in the stderr output
-    fn len(&self) -> usize {
-        // Account for usize underflows
-        if self.range.1 > self.range.0 {
-            self.range.1 - self.range.0
-        } else {
-            self.range.0 - self.range.1
-        }
-    }
-
-    fn takes_space(&self) -> bool {
-        // Multiline annotations always have to keep vertical space.
-        matches!(
-            self.annotation_part,
-            DisplayAnnotationPart::MultilineStart(_) | DisplayAnnotationPart::MultilineEnd(_)
-        )
-    }
-}
-
 /// Raw line - a line which does not have the `lineno` part and is not considered
 /// a part of the snippet.
 #[derive(Debug, PartialEq)]
@@ -847,7 +565,7 @@ pub(crate) enum DisplayRawLine<'a> {
 }
 
 /// An inline text fragment which any label is composed of.
-#[derive(Clone, Debug, PartialEq)]
+#[derive(Debug, PartialEq)]
 pub(crate) struct DisplayTextFragment<'a> {
     pub(crate) content: &'a str,
     pub(crate) style: DisplayTextStyle,
@@ -870,9 +588,9 @@ pub(crate) enum DisplayAnnotationPart {
     /// A continuation of a multi-line label of an annotation.
     LabelContinuation,
     /// A line starting a multiline annotation.
-    MultilineStart(usize),
+    MultilineStart,
     /// A line ending a multiline annotation.
-    MultilineEnd(usize),
+    MultilineEnd,
 }
 
 /// A visual mark used in `inline_marks` field of the `DisplaySourceLine`.
@@ -886,7 +604,9 @@ pub(crate) struct DisplayMark {
 #[derive(Debug, Clone, PartialEq)]
 pub(crate) enum DisplayMarkType {
     /// A mark indicating a multiline annotation going through the current line.
-    AnnotationThrough(usize),
+    AnnotationThrough,
+    /// A mark indicating a multiline annotation starting on the given line.
+    AnnotationStart,
 }
 
 /// A type of the `Annotation` which may impact the sigils, style or text displayed.
@@ -938,8 +658,7 @@ impl<'a> CursorLines<'a> {
     }
 }
 
-#[derive(Copy, Clone, Debug, PartialEq)]
-pub(crate) enum EndLine {
+enum EndLine {
     Eof = 0,
     Crlf = 1,
     Lf = 2,
@@ -1128,20 +847,13 @@ fn format_header<'a>(
 
         for item in body {
             if let DisplayLine::Source {
-                line:
-                    DisplaySourceLine::Content {
-                        text,
-                        range,
-                        end_line,
-                    },
+                line: DisplaySourceLine::Content { text, range },
                 lineno,
                 ..
             } = item
             {
-                if main_range >= range.0 && main_range <= range.1 + *end_line as usize {
-                    let char_column = text[0..(main_range - range.0).min(text.len())]
-                        .chars()
-                        .count();
+                if main_range >= range.0 && main_range <= range.1 {
+                    let char_column = text[0..(main_range - range.0)].chars().count();
                     col = char_column + 1;
                     line_offset = lineno.unwrap_or(1);
                     break;
@@ -1181,7 +893,7 @@ fn fold_prefix_suffix(mut snippet: snippet::Snippet<'_>) -> snippet::Snippet<'_>
     if let Some(before_new_start) = snippet.source[0..ann_start].rfind('\n') {
         let new_start = before_new_start + 1;
 
-        let line_offset = snippet.source[..new_start].lines().count();
+        let line_offset = newline_count(&snippet.source[..new_start]);
         snippet.line_start += line_offset;
 
         snippet.source = &snippet.source[new_start..];
@@ -1207,6 +919,17 @@ fn fold_prefix_suffix(mut snippet: snippet::Snippet<'_>) -> snippet::Snippet<'_>
     snippet
 }
 
+fn newline_count(body: &str) -> usize {
+    #[cfg(feature = "simd")]
+    {
+        memchr::memchr_iter(b'\n', body.as_bytes()).count()
+    }
+    #[cfg(not(feature = "simd"))]
+    {
+        body.lines().count()
+    }
+}
+
 fn fold_body(body: Vec<DisplayLine<'_>>) -> Vec<DisplayLine<'_>> {
     const INNER_CONTEXT: usize = 1;
     const INNER_UNFOLD_SIZE: usize = INNER_CONTEXT * 2 + 1;
@@ -1238,7 +961,10 @@ fn fold_body(body: Vec<DisplayLine<'_>>) -> Vec<DisplayLine<'_>> {
                                         ref inline_marks, ..
                                     } = line
                                     {
-                                        let inline_marks = inline_marks.clone();
+                                        let mut inline_marks = inline_marks.clone();
+                                        for mark in &mut inline_marks {
+                                            mark.mark_type = DisplayMarkType::AnnotationThrough;
+                                        }
                                         Some(inline_marks)
                                     } else {
                                         None
@@ -1297,75 +1023,16 @@ fn format_body(
     let mut label_right_margin = 0;
     let mut max_line_len = 0;
 
-    let mut depth_map: HashMap<usize, usize> = HashMap::new();
-    let mut current_depth = 0;
     let mut annotations = snippet.annotations;
-    let ranges = annotations
-        .iter()
-        .map(|a| a.range.clone())
-        .collect::<Vec<_>>();
-    // We want to merge multiline annotations that have the same range into one
-    // multiline annotation to save space. This is done by making any duplicate
-    // multiline annotations into a single-line annotation pointing at the end
-    // of the range.
-    //
-    // 3 |       X0 Y0 Z0
-    //   |  _____^
-    //   | | ____|
-    //   | || ___|
-    //   | |||
-    // 4 | |||   X1 Y1 Z1
-    // 5 | |||   X2 Y2 Z2
-    //   | |||    ^
-    //   | |||____|
-    //   |  ||____`X` is a good letter
-    //   |   |____`Y` is a good letter too
-    //   |        `Z` label
-    // Should be
-    // error: foo
-    //  --> test.rs:3:3
-    //   |
-    // 3 | /   X0 Y0 Z0
-    // 4 | |   X1 Y1 Z1
-    // 5 | |   X2 Y2 Z2
-    //   | |    ^
-    //   | |____|
-    //   |      `X` is a good letter
-    //   |      `Y` is a good letter too
-    //   |      `Z` label
-    //   |
-    ranges.iter().enumerate().for_each(|(r_idx, range)| {
-        annotations
-            .iter_mut()
-            .enumerate()
-            .skip(r_idx + 1)
-            .for_each(|(ann_idx, ann)| {
-                // Skip if the annotation's index matches the range index
-                if ann_idx != r_idx
-                    // We only want to merge multiline annotations
-                    && snippet.source[ann.range.clone()].lines().count() > 1
-                    // We only want to merge annotations that have the same range
-                    && ann.range.start == range.start
-                    && ann.range.end == range.end
-                {
-                    ann.range.start = ann.range.end.saturating_sub(1);
-                }
-            });
-    });
-    annotations.sort_by_key(|a| a.range.start);
-    let mut annotations = annotations.into_iter().enumerate().collect::<Vec<_>>();
-
     for (idx, (line, end_line)) in CursorLines::new(snippet.source).enumerate() {
         let line_length: usize = line.len();
         let line_range = (current_index, current_index + line_length);
-        let end_line_size = end_line as usize;
         body.push(DisplayLine::Source {
             lineno: Some(current_line),
             inline_marks: vec![],
             line: DisplaySourceLine::Content {
                 text: line,
                 range: line_range,
-                end_line,
             },
             annotations: vec![],
         });
@@ -1389,10 +1056,10 @@ fn format_body(
         let line_start_index = line_range.0;
         let line_end_index = line_range.1;
         current_line += 1;
-        current_index += line_length + end_line_size;
+        current_index += line_length + end_line as usize;
 
         // It would be nice to use filter_drain here once it's stable.
-        annotations.retain(|(key, annotation)| {
+        annotations.retain(|annotation| {
             let body_idx = idx;
             let annotation_type = match annotation.level {
                 snippet::Level::Error => DisplayAnnotationType::None,
@@ -1401,24 +1068,18 @@ fn format_body(
             };
             let label_right = annotation.label.map_or(0, |label| label.len() + 1);
             match annotation.range {
-                // This handles if the annotation is on the next line. We add
-                // the `end_line_size` to account for annotating the line end.
-                Range { start, .. } if start > line_end_index + end_line_size => true,
-                // This handles the case where an annotation is contained
-                // within the current line including any line-end characters.
+                Range { start, .. } if start > line_end_index => true,
                 Range { start, end }
-                    if start >= line_start_index
-                        // We add at least one to `line_end_index` to allow
-                        // highlighting the end of a file
-                        && end <= line_end_index + max(end_line_size, 1) =>
+                    if start >= line_start_index && end <= line_end_index
+                        // Allow annotating eof or stripped eol
+                        || start == line_end_index && end - start <= 1 =>
                 {
                     if let DisplayLine::Source {
                         ref mut annotations,
                         ..
                     } = body[body_idx]
                     {
-                        let annotation_start_col = line
-                            [0..(start - line_start_index).min(line_length)]
+                        let annotation_start_col = line[0..(start - line_start_index)]
                             .chars()
                             .map(|c| unicode_width::UnicodeWidthChar::width(c).unwrap_or(0))
                             .sum::<usize>();
@@ -1451,21 +1112,28 @@ fn format_body(
                     }
                     false
                 }
-                // This handles the case where a multiline annotation starts
-                // somewhere on the current line, including any line-end chars
                 Range { start, end }
                     if start >= line_start_index
-                        // The annotation can start on a line ending
-                        && start <= line_end_index + end_line_size.saturating_sub(1)
+                        && start <= line_end_index
                         && end > line_end_index =>
                 {
-                    if let DisplayLine::Source {
+                    if start - line_start_index == 0 {
+                        if let DisplayLine::Source {
+                            ref mut inline_marks,
+                            ..
+                        } = body[body_idx]
+                        {
+                            inline_marks.push(DisplayMark {
+                                mark_type: DisplayMarkType::AnnotationStart,
+                                annotation_type: DisplayAnnotationType::from(annotation.level),
+                            });
+                        }
+                    } else if let DisplayLine::Source {
                         ref mut annotations,
                         ..
                     } = body[body_idx]
                     {
-                        let annotation_start_col = line
-                            [0..(start - line_start_index).min(line_length)]
+                        let annotation_start_col = line[0..(start - line_start_index)]
                             .chars()
                             .map(|c| unicode_width::UnicodeWidthChar::width(c).unwrap_or(0))
                             .sum::<usize>();
@@ -1485,67 +1153,52 @@ fn format_body(
                             },
                             range,
                             annotation_type: DisplayAnnotationType::from(annotation.level),
-                            annotation_part: DisplayAnnotationPart::MultilineStart(current_depth),
+                            annotation_part: DisplayAnnotationPart::MultilineStart,
                         });
-                        depth_map.insert(*key, current_depth);
-                        current_depth += 1;
                     }
                     true
                 }
-                // This handles the case where a multiline annotation starts
-                // somewhere before this line and ends after it as well
-                Range { start, end }
-                    if start < line_start_index && end > line_end_index + max(end_line_size, 1) =>
-                {
+                Range { start, end } if start < line_start_index && end > line_end_index => {
                     if let DisplayLine::Source {
                         ref mut inline_marks,
                         ..
                     } = body[body_idx]
                     {
-                        let depth = depth_map.get(key).cloned().unwrap_or_default();
                         inline_marks.push(DisplayMark {
-                            mark_type: DisplayMarkType::AnnotationThrough(depth),
+                            mark_type: DisplayMarkType::AnnotationThrough,
                             annotation_type: DisplayAnnotationType::from(annotation.level),
                         });
                     }
                     true
                 }
-                // This handles the case where a multiline annotation ends
-                // somewhere on the current line, including any line-end chars
                 Range { start, end }
                     if start < line_start_index
                         && end >= line_start_index
-                        // We add at least one to `line_end_index` to allow
-                        // highlighting the end of a file
-                        && end <= line_end_index + max(end_line_size, 1) =>
+                        && end <= line_end_index =>
                 {
                     if let DisplayLine::Source {
+                        ref mut inline_marks,
                         ref mut annotations,
                         ..
                     } = body[body_idx]
                     {
-                        let end_mark = line[0..(end - line_start_index).min(line_length)]
+                        inline_marks.push(DisplayMark {
+                            mark_type: DisplayMarkType::AnnotationThrough,
+                            annotation_type: DisplayAnnotationType::from(annotation.level),
+                        });
+                        let end_mark = line[0..(end - line_start_index)]
                             .chars()
                             .map(|c| unicode_width::UnicodeWidthChar::width(c).unwrap_or(0))
                             .sum::<usize>()
                             .saturating_sub(1);
-                        // If the annotation ends on a line-end character, we
-                        // need to annotate one past the end of the line
-                        let (end_mark, end_plus_one) = if end > line_end_index
-                            // Special case for highlighting the end of a file
-                            || (end == line_end_index + 1 && end_line_size == 0)
-                        {
-                            (end_mark + 1, end_mark + 2)
-                        } else {
-                            (end_mark, end_mark + 1)
-                        };
+
+                        let end_plus_one = end_mark + 1;
 
                         span_left_margin = min(span_left_margin, end_mark);
                         span_right_margin = max(span_right_margin, end_plus_one);
                         label_right_margin = max(label_right_margin, end_plus_one + label_right);
 
                         let range = (end_mark, end_plus_one);
-                        let depth = depth_map.remove(key).unwrap_or(0);
                         annotations.push(DisplaySourceAnnotation {
                             annotation: Annotation {
                                 annotation_type,
@@ -1554,7 +1207,7 @@ fn format_body(
                             },
                             range,
                             annotation_type: DisplayAnnotationType::from(annotation.level),
-                            annotation_part: DisplayAnnotationPart::MultilineEnd(depth),
+                            annotation_part: DisplayAnnotationPart::MultilineEnd,
                         });
                     }
                     false
@@ -1562,12 +1215,6 @@ fn format_body(
                 _ => true,
             }
         });
-        // Reset the depth counter, but only after we've processed all
-        // annotations for a given line.
-        let max = depth_map.len();
-        if current_depth > max {
-            current_depth = max;
-        }
     }
 
     if snippet.fold {
@@ -1628,15 +1275,25 @@ fn format_body(
     }
 }
 
+fn format_repeat_char(c: char, n: usize, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+    for _ in 0..n {
+        f.write_char(c)?;
+    }
+    Ok(())
+}
+
 #[inline]
-fn annotation_type_str(annotation_type: &DisplayAnnotationType) -> &'static str {
+fn format_annotation_type(
+    annotation_type: &DisplayAnnotationType,
+    f: &mut fmt::Formatter<'_>,
+) -> fmt::Result {
     match annotation_type {
-        DisplayAnnotationType::Error => ERROR_TXT,
-        DisplayAnnotationType::Help => HELP_TXT,
-        DisplayAnnotationType::Info => INFO_TXT,
-        DisplayAnnotationType::Note => NOTE_TXT,
-        DisplayAnnotationType::Warning => WARNING_TXT,
-        DisplayAnnotationType::None => "",
+        DisplayAnnotationType::Error => f.write_str(ERROR_TXT),
+        DisplayAnnotationType::Help => f.write_str(HELP_TXT),
+        DisplayAnnotationType::Info => f.write_str(INFO_TXT),
+        DisplayAnnotationType::Note => f.write_str(NOTE_TXT),
+        DisplayAnnotationType::Warning => f.write_str(WARNING_TXT),
+        DisplayAnnotationType::None => Ok(()),
     }
 }
 
@@ -1695,30 +1352,3 @@ fn normalize_whitespace(str: &str) -> String {
     }
     s
 }
-
-fn overlaps(
-    a1: &DisplaySourceAnnotation<'_>,
-    a2: &DisplaySourceAnnotation<'_>,
-    padding: usize,
-) -> bool {
-    (a2.range.0..a2.range.1).contains(&a1.range.0)
-        || (a1.range.0..a1.range.1 + padding).contains(&a2.range.0)
-}
-
-fn format_inline_marks(
-    line: usize,
-    inline_marks: &[DisplayMark],
-    lineno_width: usize,
-    stylesheet: &Stylesheet,
-    buf: &mut StyledBuffer,
-) -> fmt::Result {
-    for mark in inline_marks.iter() {
-        let annotation_style = get_annotation_style(&mark.annotation_type, stylesheet);
-        match mark.mark_type {
-            DisplayMarkType::AnnotationThrough(depth) => {
-                buf.putc(line, 3 + lineno_width + depth, '|', *annotation_style);
-            }
-        };
-    }
-    Ok(())
-}
diff --git a/src/renderer/mod.rs b/src/renderer/mod.rs
index b9edcc6..845d293 100644
--- a/src/renderer/mod.rs
+++ b/src/renderer/mod.rs
@@ -12,7 +12,6 @@
 
 mod display_list;
 mod margin;
-mod styled_buffer;
 pub(crate) mod stylesheet;
 
 use crate::snippet::Message;
diff --git a/src/renderer/styled_buffer.rs b/src/renderer/styled_buffer.rs
deleted file mode 100644
index ec834e1..0000000
--- a/src/renderer/styled_buffer.rs
+++ /dev/null
@@ -1,97 +0,0 @@
-//! Adapted from [styled_buffer]
-//!
-//! [styled_buffer]: https://github.com/rust-lang/rust/blob/894f7a4ba6554d3797404bbf550d9919df060b97/compiler/rustc_errors/src/styled_buffer.rs
-
-use crate::renderer::stylesheet::Stylesheet;
-use anstyle::Style;
-use std::fmt;
-use std::fmt::Write;
-
-#[derive(Debug)]
-pub(crate) struct StyledBuffer {
-    lines: Vec<Vec<StyledChar>>,
-}
-
-#[derive(Clone, Copy, Debug, PartialEq)]
-pub(crate) struct StyledChar {
-    ch: char,
-    style: Style,
-}
-
-impl StyledChar {
-    pub(crate) const SPACE: Self = StyledChar::new(' ', Style::new());
-
-    pub(crate) const fn new(ch: char, style: Style) -> StyledChar {
-        StyledChar { ch, style }
-    }
-}
-
-impl StyledBuffer {
-    pub(crate) fn new() -> StyledBuffer {
-        StyledBuffer { lines: vec![] }
-    }
-
-    fn ensure_lines(&mut self, line: usize) {
-        if line >= self.lines.len() {
-            self.lines.resize(line + 1, Vec::new());
-        }
-    }
-
-    pub(crate) fn render(&self, stylesheet: &Stylesheet) -> Result<String, fmt::Error> {
-        let mut str = String::new();
-        for (i, line) in self.lines.iter().enumerate() {
-            let mut current_style = stylesheet.none;
-            for ch in line {
-                if ch.style != current_style {
-                    if !line.is_empty() {
-                        write!(str, "{}", current_style.render_reset())?;
-                    }
-                    current_style = ch.style;
-                    write!(str, "{}", current_style.render())?;
-                }
-                write!(str, "{}", ch.ch)?;
-            }
-            write!(str, "{}", current_style.render_reset())?;
-            if i != self.lines.len() - 1 {
-                writeln!(str)?;
-            }
-        }
-        Ok(str)
-    }
-
-    /// Sets `chr` with `style` for given `line`, `col`.
-    /// If `line` does not exist in our buffer, adds empty lines up to the given
-    /// and fills the last line with unstyled whitespace.
-    pub(crate) fn putc(&mut self, line: usize, col: usize, chr: char, style: Style) {
-        self.ensure_lines(line);
-        if col >= self.lines[line].len() {
-            self.lines[line].resize(col + 1, StyledChar::SPACE);
-        }
-        self.lines[line][col] = StyledChar::new(chr, style);
-    }
-
-    /// Sets `string` with `style` for given `line`, starting from `col`.
-    /// If `line` does not exist in our buffer, adds empty lines up to the given
-    /// and fills the last line with unstyled whitespace.
-    pub(crate) fn puts(&mut self, line: usize, col: usize, string: &str, style: Style) {
-        let mut n = col;
-        for c in string.chars() {
-            self.putc(line, n, c, style);
-            n += 1;
-        }
-    }
-    /// For given `line` inserts `string` with `style` after old content of that line,
-    /// adding lines if needed
-    pub(crate) fn append(&mut self, line: usize, string: &str, style: Style) {
-        if line >= self.lines.len() {
-            self.puts(line, 0, string, style);
-        } else {
-            let col = self.lines[line].len();
-            self.puts(line, col, string, style);
-        }
-    }
-
-    pub(crate) fn num_lines(&self) -> usize {
-        self.lines.len()
-    }
-}


Test patch:
diff --git a/tests/fixtures/color/ann_eof.svg b/tests/fixtures/color/ann_eof.svg
deleted file mode 100644
index bb12aec..0000000
--- a/tests/fixtures/color/ann_eof.svg
+++ /dev/null
@@ -1,36 +0,0 @@
-<svg width="740px" height="128px" xmlns="http://www.w3.org/2000/svg">
-  <style>
-    .fg { fill: #AAAAAA }
-    .bg { background: #000000 }
-    .fg-bright-blue { fill: #5555FF }
-    .fg-bright-red { fill: #FF5555 }
-    .container {
-      padding: 0 10px;
-      line-height: 18px;
-    }
-    .bold { font-weight: bold; }
-    tspan {
-      font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
-      white-space: pre;
-      line-height: 18px;
-    }
-  </style>
-
-  <rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
-
-  <text xml:space="preserve" class="container fg">
-    <tspan x="10px" y="28px"><tspan class="fg-bright-red bold">error</tspan><tspan>: </tspan><tspan class="bold">expected `.`, `=`</tspan>
-</tspan>
-    <tspan x="10px" y="46px"><tspan> </tspan><tspan class="fg-bright-blue bold">--&gt;</tspan><tspan> Cargo.toml:1:5</tspan>
-</tspan>
-    <tspan x="10px" y="64px"><tspan>  </tspan><tspan class="fg-bright-blue bold">|</tspan>
-</tspan>
-    <tspan x="10px" y="82px"><tspan class="fg-bright-blue bold">1 |</tspan><tspan> asdf</tspan>
-</tspan>
-    <tspan x="10px" y="100px"><tspan>  </tspan><tspan class="fg-bright-blue bold">|</tspan><tspan>     </tspan><tspan class="fg-bright-red bold">^</tspan>
-</tspan>
-    <tspan x="10px" y="118px"><tspan>  </tspan><tspan class="fg-bright-blue bold">|</tspan>
-</tspan>
-  </text>
-
-</svg>
diff --git a/tests/fixtures/color/ann_insertion.svg b/tests/fixtures/color/ann_insertion.svg
deleted file mode 100644
index 1f4b6a2..0000000
--- a/tests/fixtures/color/ann_insertion.svg
+++ /dev/null
@@ -1,36 +0,0 @@
-<svg width="740px" height="128px" xmlns="http://www.w3.org/2000/svg">
-  <style>
-    .fg { fill: #AAAAAA }
-    .bg { background: #000000 }
-    .fg-bright-blue { fill: #5555FF }
-    .fg-bright-red { fill: #FF5555 }
-    .container {
-      padding: 0 10px;
-      line-height: 18px;
-    }
-    .bold { font-weight: bold; }
-    tspan {
-      font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
-      white-space: pre;
-      line-height: 18px;
-    }
-  </style>
-
-  <rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
-
-  <text xml:space="preserve" class="container fg">
-    <tspan x="10px" y="28px"><tspan class="fg-bright-red bold">error</tspan><tspan>: </tspan><tspan class="bold">expected `.`, `=`</tspan>
-</tspan>
-    <tspan x="10px" y="46px"><tspan> </tspan><tspan class="fg-bright-blue bold">--&gt;</tspan><tspan> Cargo.toml:1:3</tspan>
-</tspan>
-    <tspan x="10px" y="64px"><tspan>  </tspan><tspan class="fg-bright-blue bold">|</tspan>
-</tspan>
-    <tspan x="10px" y="82px"><tspan class="fg-bright-blue bold">1 |</tspan><tspan> asf</tspan>
-</tspan>
-    <tspan x="10px" y="100px"><tspan>  </tspan><tspan class="fg-bright-blue bold">|</tspan><tspan>   </tspan><tspan class="fg-bright-red bold">^</tspan><tspan> </tspan><tspan class="fg-bright-red bold">'d' belongs here</tspan>
-</tspan>
-    <tspan x="10px" y="118px"><tspan>  </tspan><tspan class="fg-bright-blue bold">|</tspan>
-</tspan>
-  </text>
-
-</svg>
diff --git a/tests/fixtures/color/ann_multiline.svg b/tests/fixtures/color/ann_multiline.svg
deleted file mode 100644
index 9130691..0000000
--- a/tests/fixtures/color/ann_multiline.svg
+++ /dev/null
@@ -1,42 +0,0 @@
-<svg width="740px" height="182px" xmlns="http://www.w3.org/2000/svg">
-  <style>
-    .fg { fill: #AAAAAA }
-    .bg { background: #000000 }
-    .fg-bright-blue { fill: #5555FF }
-    .fg-bright-red { fill: #FF5555 }
-    .container {
-      padding: 0 10px;
-      line-height: 18px;
-    }
-    .bold { font-weight: bold; }
-    tspan {
-      font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
-      white-space: pre;
-      line-height: 18px;
-    }
-  </style>
-
-  <rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
-
-  <text xml:space="preserve" class="container fg">
-    <tspan x="10px" y="28px"><tspan class="fg-bright-red bold">error[E0027]</tspan><tspan>: </tspan><tspan class="bold">pattern does not mention fields `lineno`, `content`</tspan>
-</tspan>
-    <tspan x="10px" y="46px"><tspan>   </tspan><tspan class="fg-bright-blue bold">--&gt;</tspan><tspan> src/display_list.rs:139:32</tspan>
-</tspan>
-    <tspan x="10px" y="64px"><tspan>    </tspan><tspan class="fg-bright-blue bold">|</tspan>
-</tspan>
-    <tspan x="10px" y="82px"><tspan class="fg-bright-blue bold">139 |</tspan><tspan>                           if let DisplayLine::Source {</tspan>
-</tspan>
-    <tspan x="10px" y="100px"><tspan>    </tspan><tspan class="fg-bright-blue bold">|</tspan><tspan>  </tspan><tspan class="fg-bright-red bold">________________________________^</tspan>
-</tspan>
-    <tspan x="10px" y="118px"><tspan class="fg-bright-blue bold">140 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>                             ref mut inline_marks,</tspan>
-</tspan>
-    <tspan x="10px" y="136px"><tspan class="fg-bright-blue bold">141 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>                         } = body[body_idx]</tspan>
-</tspan>
-    <tspan x="10px" y="154px"><tspan>    </tspan><tspan class="fg-bright-blue bold">|</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|_________________________^</tspan><tspan> </tspan><tspan class="fg-bright-red bold">missing fields `lineno`, `content`</tspan>
-</tspan>
-    <tspan x="10px" y="172px"><tspan>    </tspan><tspan class="fg-bright-blue bold">|</tspan>
-</tspan>
-  </text>
-
-</svg>
diff --git a/tests/fixtures/color/ann_multiline2.svg b/tests/fixtures/color/ann_multiline2.svg
deleted file mode 100644
index 97948a4..0000000
--- a/tests/fixtures/color/ann_multiline2.svg
+++ /dev/null
@@ -1,40 +0,0 @@
-<svg width="740px" height="164px" xmlns="http://www.w3.org/2000/svg">
-  <style>
-    .fg { fill: #AAAAAA }
-    .bg { background: #000000 }
-    .fg-bright-blue { fill: #5555FF }
-    .fg-bright-red { fill: #FF5555 }
-    .container {
-      padding: 0 10px;
-      line-height: 18px;
-    }
-    .bold { font-weight: bold; }
-    tspan {
-      font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
-      white-space: pre;
-      line-height: 18px;
-    }
-  </style>
-
-  <rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
-
-  <text xml:space="preserve" class="container fg">
-    <tspan x="10px" y="28px"><tspan class="fg-bright-red bold">error[E####]</tspan><tspan>: </tspan><tspan class="bold">spacing error found</tspan>
-</tspan>
-    <tspan x="10px" y="46px"><tspan>  </tspan><tspan class="fg-bright-blue bold">--&gt;</tspan><tspan> foo.txt:26:12</tspan>
-</tspan>
-    <tspan x="10px" y="64px"><tspan>   </tspan><tspan class="fg-bright-blue bold">|</tspan>
-</tspan>
-    <tspan x="10px" y="82px"><tspan class="fg-bright-blue bold">26 |</tspan><tspan> This is an example</tspan>
-</tspan>
-    <tspan x="10px" y="100px"><tspan>   </tspan><tspan class="fg-bright-blue bold">|</tspan><tspan>            </tspan><tspan class="fg-bright-red bold">^^^^^^^</tspan><tspan> </tspan><tspan class="fg-bright-red bold">this should not be on separate lines</tspan>
-</tspan>
-    <tspan x="10px" y="118px"><tspan class="fg-bright-blue bold">27 |</tspan><tspan> of an edge case of an annotation overflowing</tspan>
-</tspan>
-    <tspan x="10px" y="136px"><tspan class="fg-bright-blue bold">28 |</tspan><tspan> to exactly one character on next line.</tspan>
-</tspan>
-    <tspan x="10px" y="154px"><tspan>   </tspan><tspan class="fg-bright-blue bold">|</tspan>
-</tspan>
-  </text>
-
-</svg>
diff --git a/tests/fixtures/color/ann_removed_nl.svg b/tests/fixtures/color/ann_removed_nl.svg
deleted file mode 100644
index bb12aec..0000000
--- a/tests/fixtures/color/ann_removed_nl.svg
+++ /dev/null
@@ -1,36 +0,0 @@
-<svg width="740px" height="128px" xmlns="http://www.w3.org/2000/svg">
-  <style>
-    .fg { fill: #AAAAAA }
-    .bg { background: #000000 }
-    .fg-bright-blue { fill: #5555FF }
-    .fg-bright-red { fill: #FF5555 }
-    .container {
-      padding: 0 10px;
-      line-height: 18px;
-    }
-    .bold { font-weight: bold; }
-    tspan {
-      font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
-      white-space: pre;
-      line-height: 18px;
-    }
-  </style>
-
-  <rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
-
-  <text xml:space="preserve" class="container fg">
-    <tspan x="10px" y="28px"><tspan class="fg-bright-red bold">error</tspan><tspan>: </tspan><tspan class="bold">expected `.`, `=`</tspan>
-</tspan>
-    <tspan x="10px" y="46px"><tspan> </tspan><tspan class="fg-bright-blue bold">--&gt;</tspan><tspan> Cargo.toml:1:5</tspan>
-</tspan>
-    <tspan x="10px" y="64px"><tspan>  </tspan><tspan class="fg-bright-blue bold">|</tspan>
-</tspan>
-    <tspan x="10px" y="82px"><tspan class="fg-bright-blue bold">1 |</tspan><tspan> asdf</tspan>
-</tspan>
-    <tspan x="10px" y="100px"><tspan>  </tspan><tspan class="fg-bright-blue bold">|</tspan><tspan>     </tspan><tspan class="fg-bright-red bold">^</tspan>
-</tspan>
-    <tspan x="10px" y="118px"><tspan>  </tspan><tspan class="fg-bright-blue bold">|</tspan>
-</tspan>
-  </text>
-
-</svg>
diff --git a/tests/fixtures/color/ensure-emoji-highlight-width.svg b/tests/fixtures/color/ensure-emoji-highlight-width.svg
deleted file mode 100644
index e5646e6..0000000
--- a/tests/fixtures/color/ensure-emoji-highlight-width.svg
+++ /dev/null
@@ -1,36 +0,0 @@
-<svg width="1356px" height="128px" xmlns="http://www.w3.org/2000/svg">
-  <style>
-    .fg { fill: #AAAAAA }
-    .bg { background: #000000 }
-    .fg-bright-blue { fill: #5555FF }
-    .fg-bright-red { fill: #FF5555 }
-    .container {
-      padding: 0 10px;
-      line-height: 18px;
-    }
-    .bold { font-weight: bold; }
-    tspan {
-      font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
-      white-space: pre;
-      line-height: 18px;
-    }
-  </style>
-
-  <rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
-
-  <text xml:space="preserve" class="container fg">
-    <tspan x="10px" y="28px"><tspan class="fg-bright-red bold">error</tspan><tspan>: </tspan><tspan class="bold">invalid character ` ` in package name: `haha this isn't a valid name 🐛`, characters must be Unicode XID characters (numbers, `-`, `_`, or most letters)</tspan>
-</tspan>
-    <tspan x="10px" y="46px"><tspan> </tspan><tspan class="fg-bright-blue bold">--&gt;</tspan><tspan> &lt;file&gt;:7:1</tspan>
-</tspan>
-    <tspan x="10px" y="64px"><tspan>  </tspan><tspan class="fg-bright-blue bold">|</tspan>
-</tspan>
-    <tspan x="10px" y="82px"><tspan class="fg-bright-blue bold">7 |</tspan><tspan> "haha this isn't a valid name 🐛" = { package = "libc", version = "0.1" }</tspan>
-</tspan>
-    <tspan x="10px" y="100px"><tspan>  </tspan><tspan class="fg-bright-blue bold">|</tspan><tspan> </tspan><tspan class="fg-bright-red bold">^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</tspan>
-</tspan>
-    <tspan x="10px" y="118px"><tspan>  </tspan><tspan class="fg-bright-blue bold">|</tspan>
-</tspan>
-  </text>
-
-</svg>
diff --git a/tests/fixtures/color/fold_ann_multiline.svg b/tests/fixtures/color/fold_ann_multiline.svg
deleted file mode 100644
index 6a89c4f..0000000
--- a/tests/fixtures/color/fold_ann_multiline.svg
+++ /dev/null
@@ -1,49 +0,0 @@
-<svg width="869px" height="236px" xmlns="http://www.w3.org/2000/svg">
-  <style>
-    .fg { fill: #AAAAAA }
-    .bg { background: #000000 }
-    .fg-bright-blue { fill: #5555FF }
-    .fg-bright-red { fill: #FF5555 }
-    .fg-yellow { fill: #AA5500 }
-    .container {
-      padding: 0 10px;
-      line-height: 18px;
-    }
-    .bold { font-weight: bold; }
-    tspan {
-      font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
-      white-space: pre;
-      line-height: 18px;
-    }
-  </style>
-
-  <rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
-
-  <text xml:space="preserve" class="container fg">
-    <tspan x="10px" y="28px"><tspan class="fg-bright-red bold">error[E0308]</tspan><tspan>: </tspan><tspan class="bold">mismatched types</tspan>
-</tspan>
-    <tspan x="10px" y="46px"><tspan>  </tspan><tspan class="fg-bright-blue bold">--&gt;</tspan><tspan> src/format.rs:51:6</tspan>
-</tspan>
-    <tspan x="10px" y="64px"><tspan>   </tspan><tspan class="fg-bright-blue bold">|</tspan>
-</tspan>
-    <tspan x="10px" y="82px"><tspan class="fg-bright-blue bold">51 |</tspan><tspan>   ) -&gt; Option&lt;String&gt; {</tspan>
-</tspan>
-    <tspan x="10px" y="100px"><tspan>   </tspan><tspan class="fg-bright-blue bold">|</tspan><tspan>        </tspan><tspan class="fg-yellow bold">--------------</tspan><tspan> </tspan><tspan class="fg-yellow bold">expected `std::option::Option&lt;std::string::String&gt;` because of return type</tspan>
-</tspan>
-    <tspan x="10px" y="118px"><tspan class="fg-bright-blue bold">52 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">/</tspan><tspan>     for ann in annotations {</tspan>
-</tspan>
-    <tspan x="10px" y="136px"><tspan class="fg-bright-blue bold">53 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>         match (ann.range.0, ann.range.1) {</tspan>
-</tspan>
-    <tspan x="10px" y="154px"><tspan class="fg-bright-blue bold">...</tspan><tspan>  </tspan><tspan class="fg-bright-red bold">|</tspan>
-</tspan>
-    <tspan x="10px" y="172px"><tspan class="fg-bright-blue bold">71 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>         }</tspan>
-</tspan>
-    <tspan x="10px" y="190px"><tspan class="fg-bright-blue bold">72 |</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|</tspan><tspan>     }</tspan>
-</tspan>
-    <tspan x="10px" y="208px"><tspan>   </tspan><tspan class="fg-bright-blue bold">|</tspan><tspan> </tspan><tspan class="fg-bright-red bold">|_____^</tspan><tspan> </tspan><tspan class="fg-bright-red bold">expected enum `std::option::Option`, found ()</tspan>
-</tspan>
-    <tspan x="10px" y="226px"><tspan>   </tspan><tspan class="fg-bright-blue bold">|</tspan>
-</tspan>
-  </text>
-
-</svg>
diff --git a/tests/fixtures/color/fold_bad_origin_line.svg b/tests/fixtures/color/fold_bad_origin_line.svg
deleted file mode 100644
index 23f1b64..0000000
--- a/tests/fixtures/color/fold_bad_origin_line.svg
+++ /dev/null
@@ -1,37 +0,0 @@
-<svg width="740px" height="128px" xmlns="http://www.w3.org/2000/svg">
-  <style>
-    .fg { fill: #AAAAAA }
-    .bg { background: #000000 }
-    .fg-bright-blue { fill: #5555FF }
-    .fg-bright-red { fill: #FF5555 }
-    .fg-yellow { fill: #AA5500 }
-    .container {
-      padding: 0 10px;
-      line-height: 18px;
-    }
-    .bold { font-weight: bold; }
-    tspan {
-      font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
-      white-space: pre;
-      line-height: 18px;
-    }
-  </style>
-
-  <rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
-
-  <text xml:space="preserve" class="container fg">
-    <tspan x="10px" y="28px"><tspan class="fg-bright-red bold">error</tspan>
-</tspan>
-    <tspan x="10px" y="46px"><tspan> </tspan><tspan class="fg-bright-blue bold">--&gt;</tspan><tspan> path/to/error.rs:3:1</tspan>
-</tspan>
-    <tspan x="10px" y="64px"><tspan>  </tspan><tspan class="fg-bright-blue bold">|</tspan>
-</tspan>
-    <tspan x="10px" y="82px"><tspan class="fg-bright-blue bold">3 |</tspan><tspan> invalid syntax</tspan>
-</tspan>
-    <tspan x="10px" y="100px"><tspan>  </tspan><tspan class="fg-bright-blue bold">|</tspan><tspan> </tspan><tspan class="fg-yellow bold">--------------</tspan><tspan> </tspan><tspan class="fg-yellow bold">error here</tspan>
-</tspan>
-    <tspan x="10px" y="118px"><tspan>  </tspan><tspan class="fg-bright-blue bold">|</tspan>
-</tspan>
-  </text>
-
-</svg>
diff --git a/tests/fixtures/color/fold_leading.svg b/tests/fixtures/color/fold_leading.svg
deleted file mode 100644
index e69965e..0000000
--- a/tests/fixtures/color/fold_leading.svg
+++ /dev/null
@@ -1,36 +0,0 @@
-<svg width="740px" height="128px" xmlns="http://www.w3.org/2000/svg">
-  <style>
-    .fg { fill: #AAAAAA }
-    .bg { background: #000000 }
-    .fg-bright-blue { fill: #5555FF }
-    .fg-bright-red { fill: #FF5555 }
-    .container {
-      padding: 0 10px;
-      line-height: 18px;
-    }
-    .bold { font-weight: bold; }
-    tspan {
-      font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
-      white-space: pre;
-      line-height: 18px;
-    }
-  </style>
-
-  <rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
-
-  <text xml:space="preserve" class="container fg">
-    <tspan x="10px" y="28px"><tspan class="fg-bright-red bold">error[E0308]</tspan><tspan>: </tspan><tspan class="bold">invalid type: integer `20`, expected a bool</tspan>
-</tspan>
-    <tspan x="10px" y="46px"><tspan>  </tspan><tspan class="fg-bright-blue bold">--&gt;</tspan><tspan> Cargo.toml:11:13</tspan>
-</tspan>
-    <tspan x="10px" y="64px"><tspan>   </tspan><tspan class="fg-bright-blue bold">|</tspan>
-</tspan>
-    <tspan x="10px" y="82px"><tspan class="fg-bright-blue bold">11 |</tspan><tspan> workspace = 20</tspan>
-</tspan>
-    <tspan x="10px" y="100px"><tspan>   </tspan><tspan class="fg-bright-blue bold">|</tspan><tspan>             </tspan><tspan class="fg-bright-red bold">^^</tspan>
-</tspan>
-    <tspan x="10px" y="118px"><tspan>   </tspan><tspan class="fg-bright-blue bold">|</tspan>
-</tspan>
-  </text>
-
-</svg>
diff --git a/tests/fixtures/color/fold_trailing.svg b/tests/fixtures/color/fold_trailing.svg
deleted file mode 100644
index 41bf7c7..0000000
--- a/tests/fixtures/color/fold_trailing.svg
+++ /dev/null
@@ -1,36 +0,0 @@
-<svg width="740px" height="128px" xmlns="http://www.w3.org/2000/svg">
-  <style>
-    .fg { fill: #AAAAAA }
-    .bg { background: #000000 }
-    .fg-bright-blue { fill: #5555FF }
-    .fg-bright-red { fill: #FF5555 }
-    .container {
-      padding: 0 10px;
-      line-height: 18px;
-    }
-    .bold { font-weight: bold; }
-    tspan {
-      font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
-      white-space: pre;
-      line-height: 18px;
-    }
-  </style>
-
-  <rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
-
-  <text xml:space="preserve" class="container fg">
-    <tspan x="10px" y="28px"><tspan class="fg-bright-red bold">error[E0308]</tspan><tspan>: </tspan><tspan class="bold">invalid type: integer `20`, expected a lints table</tspan>
-</tspan>
-    <tspan x="10px" y="46px"><tspan> </tspan><tspan class="fg-bright-blue bold">--&gt;</tspan><tspan> Cargo.toml:1:9</tspan>
-</tspan>
-    <tspan x="10px" y="64px"><tspan>  </tspan><tspan class="fg-bright-blue bold">|</tspan>
-</tspan>
-    <tspan x="10px" y="82px"><tspan class="fg-bright-blue bold">1 |</tspan><tspan> lints = 20</tspan>
-</tspan>
-    <tspan x="10px" y="100px"><tspan>  </tspan><tspan class="fg-bright-blue bold">|</tspan><tspan>         </tspan><tspan class="fg-bright-red bold">^^</tspan>
-</tspan>
-    <tspan x="10px" y="118px"><tspan>  </tspan><tspan class="fg-bright-blue bold">|</tspan>
-</tspan>
-  </text>
-
-</svg>
diff --git a/tests/fixtures/color/issue_9.svg b/tests/fixtures/color/issue_9.svg
deleted file mode 100644
index 80b891e..0000000
--- a/tests/fixtures/color/issue_9.svg
+++ /dev/null
@@ -1,49 +0,0 @@
-<svg width="911px" height="236px" xmlns="http://www.w3.org/2000/svg">
-  <style>
-    .fg { fill: #AAAAAA }
-    .bg { background: #000000 }
-    .fg-bright-blue { fill: #5555FF }
-    .fg-bright-red { fill: #FF5555 }
-    .fg-yellow { fill: #AA5500 }
-    .container {
-      padding: 0 10px;
-      line-height: 18px;
-    }
-    .bold { font-weight: bold; }
-    tspan {
-      font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
-      white-space: pre;
-      line-height: 18px;
-    }
-  </style>
-
-  <rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
-
-  <text xml:space="preserve" class="container fg">
-    <tspan x="10px" y="28px"><tspan class="fg-bright-red bold">error</tspan><tspan>: </tspan><tspan class="bold">expected one of `.`, `;`, `?`, or an operator, found `for`</tspan>
-</tspan>
-    <tspan x="10px" y="46px"><tspan> </tspan><tspan class="fg-bright-blue bold">--&gt;</tspan><tspan> /code/rust/src/test/ui/annotate-snippet/suggestion.rs:4:5</tspan>
-</tspan>
-    <tspan x="10px" y="64px"><tspan>  </tspan><tspan class="fg-bright-blue bold">|</tspan>
-</tspan>
-    <tspan x="10px" y="82px"><tspan class="fg-bright-blue bold">4 |</tspan><tspan> let x = vec![1];</tspan>
-</tspan>
-    <tspan x="10px" y="100px"><tspan>  </tspan><tspan class="fg-bright-blue bold">|</tspan><tspan>     </tspan><tspan class="fg-yellow bold">-</tspan><tspan> </tspan><tspan class="fg-yellow bold">move occurs because `x` has type `std::vec::Vec&lt;i32&gt;`, which does not implement the `Copy` trait</tspan>
-</tspan>
-    <tspan x="10px" y="118px"><tspan>  </tspan><tspan class="fg-bright-blue bold">|</tspan>
-</tspan>
-    <tspan x="10px" y="136px"><tspan class="fg-bright-blue bold">7 |</tspan><tspan> let y = x;</tspan>
-</tspan>
-    <tspan x="10px" y="154px"><tspan>  </tspan><tspan class="fg-bright-blue bold">|</tspan><tspan>         </tspan><tspan class="fg-yellow bold">-</tspan><tspan> </tspan><tspan class="fg-yellow bold">value moved here</tspan>
-</tspan>
-    <tspan x="10px" y="172px"><tspan>  </tspan><tspan class="fg-bright-blue bold">|</tspan>
-</tspan>
-    <tspan x="10px" y="190px"><tspan class="fg-bright-blue bold">9 |</tspan><tspan> x;</tspan>
-</tspan>
-    <tspan x="10px" y="208px"><tspan>  </tspan><tspan class="fg-bright-blue bold">|</tspan><tspan> </tspan><tspan class="fg-bright-red bold">^</tspan><tspan> </tspan><tspan class="fg-bright-red bold">value used here after move</tspan>
-</tspan>
-    <tspan x="10px" y="226px"><tspan>  </tspan><tspan class="fg-bright-blue bold">|</tspan>
-</tspan>
-  </text>
-
-</svg>
diff --git a/tests/fixtures/color/multiple_annotations.svg b/tests/fixtures/color/multiple_annotations.svg
deleted file mode 100644
index 84f4749..0000000
--- a/tests/fixtures/color/multiple_annotations.svg
+++ /dev/null
@@ -1,54 +0,0 @@
-<svg width="768px" height="290px" xmlns="http://www.w3.org/2000/svg">
-  <style>
-    .fg { fill: #AAAAAA }
-    .bg { background: #000000 }
-    .fg-bright-blue { fill: #5555FF }
-    .fg-bright-red { fill: #FF5555 }
-    .container {
-      padding: 0 10px;
-      line-height: 18px;
-    }
-    .bold { font-weight: bold; }
-    tspan {
-      font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
-      white-space: pre;
-      line-height: 18px;
-    }
-  </style>
-
-  <rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
-
-  <text xml:space="preserve" class="container fg">
-    <tspan x="10px" y="28px"><tspan class="fg-bright-red bold">error</tspan>
-</tspan>
-    <tspan x="10px" y="46px"><tspan>    </tspan><tspan class="fg-bright-blue bold">|</tspan>
-</tspan>
-    <tspan x="10px" y="64px"><tspan class="fg-bright-blue bold"> 96 |</tspan><tspan> fn add_title_line(result: &amp;mut Vec&lt;String&gt;, main_annotation: Option&lt;&amp;Annotation&gt;) {</tspan>
-</tspan>
-    <tspan x="10px" y="82px"><tspan class="fg-bright-blue bold"> 97 |</tspan><tspan>     if let Some(annotation) = main_annotation {</tspan>
-</tspan>
-    <tspan x="10px" y="100px"><tspan>    </tspan><tspan class="fg-bright-blue bold">|</tspan><tspan>                 </tspan><tspan class="fg-bright-red bold">^^^^^^^^^^</tspan><tspan> </tspan><tspan class="fg-bright-red bold">Variable defined here</tspan>
-</tspan>
-    <tspan x="10px" y="118px"><tspan class="fg-bright-blue bold"> 98 |</tspan><tspan>         result.push(format_title_line(</tspan>
-</tspan>
-    <tspan x="10px" y="136px"><tspan class="fg-bright-blue bold"> 99 |</tspan><tspan>             &amp;annotation.annotation_type,</tspan>
-</tspan>
-    <tspan x="10px" y="154px"><tspan>    </tspan><tspan class="fg-bright-blue bold">|</tspan><tspan>              </tspan><tspan class="fg-bright-red bold">^^^^^^^^^^</tspan><tspan> </tspan><tspan class="fg-bright-red bold">Referenced here</tspan>
-</tspan>
-    <tspan x="10px" y="172px"><tspan class="fg-bright-blue bold">100 |</tspan><tspan>             None,</tspan>
-</tspan>
-    <tspan x="10px" y="190px"><tspan class="fg-bright-blue bold">101 |</tspan><tspan>             &amp;annotation.label,</tspan>
-</tspan>
-    <tspan x="10px" y="208px"><tspan>    </tspan><tspan class="fg-bright-blue bold">|</tspan><tspan>              </tspan><tspan class="fg-bright-red bold">^^^^^^^^^^</tspan><tspan> </tspan><tspan class="fg-bright-red bold">Referenced again here</tspan>
-</tspan>
-    <tspan x="10px" y="226px"><tspan class="fg-bright-blue bold">102 |</tspan><tspan>         ));</tspan>
-</tspan>
-    <tspan x="10px" y="244px"><tspan class="fg-bright-blue bold">103 |</tspan><tspan>     }</tspan>
-</tspan>
-    <tspan x="10px" y="262px"><tspan class="fg-bright-blue bold">104 |</tspan><tspan> }</tspan>
-</tspan>
-    <tspan x="10px" y="280px"><tspan>    </tspan><tspan class="fg-bright-blue bold">|</tspan>
-</tspan>
-  </text>
-
-</svg>
diff --git a/tests/fixtures/color/simple.svg b/tests/fixtures/color/simple.svg
deleted file mode 100644
index 7b92d23..0000000
--- a/tests/fixtures/color/simple.svg
+++ /dev/null
@@ -1,43 +0,0 @@
-<svg width="740px" height="182px" xmlns="http://www.w3.org/2000/svg">
-  <style>
-    .fg { fill: #AAAAAA }
-    .bg { background: #000000 }
-    .fg-bright-blue { fill: #5555FF }
-    .fg-bright-red { fill: #FF5555 }
-    .fg-yellow { fill: #AA5500 }
-    .container {
-      padding: 0 10px;
-      line-height: 18px;
-    }
-    .bold { font-weight: bold; }
-    tspan {
-      font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
-      white-space: pre;
-      line-height: 18px;
-    }
-  </style>
-
-  <rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
-
-  <text xml:space="preserve" class="container fg">
-    <tspan x="10px" y="28px"><tspan class="fg-bright-red bold">error</tspan><tspan>: </tspan><tspan class="bold">expected one of `.`, `;`, `?`, or an operator, found `for`</tspan>
-</tspan>
-    <tspan x="10px" y="46px"><tspan>   </tspan><tspan class="fg-bright-blue bold">--&gt;</tspan><tspan> src/format_color.rs:171:9</tspan>
-</tspan>
-    <tspan x="10px" y="64px"><tspan>    </tspan><tspan class="fg-bright-blue bold">|</tspan>
-</tspan>
-    <tspan x="10px" y="82px"><tspan class="fg-bright-blue bold">169 |</tspan><tspan>         })</tspan>
-</tspan>
-    <tspan x="10px" y="100px"><tspan>    </tspan><tspan class="fg-bright-blue bold">|</tspan><tspan>           </tspan><tspan class="fg-yellow bold">-</tspan><tspan> </tspan><tspan class="fg-yellow bold">expected one of `.`, `;`, `?`, or an operator here</tspan>
-</tspan>
-    <tspan x="10px" y="118px"><tspan class="fg-bright-blue bold">170 |</tspan>
-</tspan>
-    <tspan x="10px" y="136px"><tspan class="fg-bright-blue bold">171 |</tspan><tspan>         for line in &amp;self.body {</tspan>
-</tspan>
-    <tspan x="10px" y="154px"><tspan>    </tspan><tspan class="fg-bright-blue bold">|</tspan><tspan>         </tspan><tspan class="fg-bright-red bold">^^^</tspan><tspan> </tspan><tspan class="fg-bright-red bold">unexpected token</tspan>
-</tspan>
-    <tspan x="10px" y="172px"><tspan>    </tspan><tspan class="fg-bright-blue bold">|</tspan>
-</tspan>
-  </text>
-
-</svg>
diff --git a/tests/fixtures/color/strip_line.svg b/tests/fixtures/color/strip_line.svg
deleted file mode 100644
index 9da24fe..0000000
--- a/tests/fixtures/color/strip_line.svg
+++ /dev/null
@@ -1,36 +0,0 @@
-<svg width="740px" height="128px" xmlns="http://www.w3.org/2000/svg">
-  <style>
-    .fg { fill: #AAAAAA }
-    .bg { background: #000000 }
-    .fg-bright-blue { fill: #5555FF }
-    .fg-bright-red { fill: #FF5555 }
-    .container {
-      padding: 0 10px;
-      line-height: 18px;
-    }
-    .bold { font-weight: bold; }
-    tspan {
-      font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
-      white-space: pre;
-      line-height: 18px;
-    }
-  </style>
-
-  <rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
-
-  <text xml:space="preserve" class="container fg">
-    <tspan x="10px" y="28px"><tspan class="fg-bright-red bold">error[E0308]</tspan><tspan>: </tspan><tspan class="bold">mismatched types</tspan>
-</tspan>
-    <tspan x="10px" y="46px"><tspan>  </tspan><tspan class="fg-bright-blue bold">--&gt;</tspan><tspan> $DIR/whitespace-trimming.rs:4:193</tspan>
-</tspan>
-    <tspan x="10px" y="64px"><tspan>   </tspan><tspan class="fg-bright-blue bold">|</tspan>
-</tspan>
-    <tspan x="10px" y="82px"><tspan class="fg-bright-blue bold">LL |</tspan><tspan> </tspan><tspan class="fg-bright-blue bold">...</tspan><tspan>                   let _: () = 42;</tspan>
-</tspan>
-    <tspan x="10px" y="100px"><tspan>   </tspan><tspan class="fg-bright-blue bold">|</tspan><tspan>                                   </tspan><tspan class="fg-bright-red bold">^^</tspan><tspan> </tspan><tspan class="fg-bright-red bold">expected (), found integer</tspan>
-</tspan>
-    <tspan x="10px" y="118px"><tspan>   </tspan><tspan class="fg-bright-blue bold">|</tspan>
-</tspan>
-  </text>
-
-</svg>
diff --git a/tests/fixtures/color/strip_line_char.svg b/tests/fixtures/color/strip_line_char.svg
deleted file mode 100644
index cbafc78..0000000
--- a/tests/fixtures/color/strip_line_char.svg
+++ /dev/null
@@ -1,36 +0,0 @@
-<svg width="740px" height="128px" xmlns="http://www.w3.org/2000/svg">
-  <style>
-    .fg { fill: #AAAAAA }
-    .bg { background: #000000 }
-    .fg-bright-blue { fill: #5555FF }
-    .fg-bright-red { fill: #FF5555 }
-    .container {
-      padding: 0 10px;
-      line-height: 18px;
-    }
-    .bold { font-weight: bold; }
-    tspan {
-      font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
-      white-space: pre;
-      line-height: 18px;
-    }
-  </style>
-
-  <rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
-
-  <text xml:space="preserve" class="container fg">
-    <tspan x="10px" y="28px"><tspan class="fg-bright-red bold">error[E0308]</tspan><tspan>: </tspan><tspan class="bold">mismatched types</tspan>
-</tspan>
-    <tspan x="10px" y="46px"><tspan>  </tspan><tspan class="fg-bright-blue bold">--&gt;</tspan><tspan> $DIR/whitespace-trimming.rs:4:193</tspan>
-</tspan>
-    <tspan x="10px" y="64px"><tspan>   </tspan><tspan class="fg-bright-blue bold">|</tspan>
-</tspan>
-    <tspan x="10px" y="82px"><tspan class="fg-bright-blue bold">LL |</tspan><tspan> </tspan><tspan class="fg-bright-blue bold">...</tspan><tspan>                   let _: () = 42ñ</tspan>
-</tspan>
-    <tspan x="10px" y="100px"><tspan>   </tspan><tspan class="fg-bright-blue bold">|</tspan><tspan>                                   </tspan><tspan class="fg-bright-red bold">^^</tspan><tspan> </tspan><tspan class="fg-bright-red bold">expected (), found integer</tspan>
-</tspan>
-    <tspan x="10px" y="118px"><tspan>   </tspan><tspan class="fg-bright-blue bold">|</tspan>
-</tspan>
-  </text>
-
-</svg>
diff --git a/tests/fixtures/color/strip_line_non_ws.svg b/tests/fixtures/color/strip_line_non_ws.svg
deleted file mode 100644
index e4f8a85..0000000
--- a/tests/fixtures/color/strip_line_non_ws.svg
+++ /dev/null
@@ -1,40 +0,0 @@
-<svg width="1196px" height="164px" xmlns="http://www.w3.org/2000/svg">
-  <style>
-    .fg { fill: #AAAAAA }
-    .bg { background: #000000 }
-    .fg-bright-blue { fill: #5555FF }
-    .fg-bright-red { fill: #FF5555 }
-    .container {
-      padding: 0 10px;
-      line-height: 18px;
-    }
-    .bold { font-weight: bold; }
-    tspan {
-      font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
-      white-space: pre;
-      line-height: 18px;
-    }
-  </style>
-
-  <rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
-
-  <text xml:space="preserve" class="container fg">
-    <tspan x="10px" y="28px"><tspan class="fg-bright-red bold">error[E0308]</tspan><tspan>: </tspan><tspan class="bold">mismatched types</tspan>
-</tspan>
-    <tspan x="10px" y="46px"><tspan>  </tspan><tspan class="fg-bright-blue bold">--&gt;</tspan><tspan> $DIR/non-whitespace-trimming.rs:4:242</tspan>
-</tspan>
-    <tspan x="10px" y="64px"><tspan>   </tspan><tspan class="fg-bright-blue bold">|</tspan>
-</tspan>
-    <tspan x="10px" y="82px"><tspan class="fg-bright-blue bold">LL |</tspan><tspan> </tspan><tspan class="fg-bright-blue bold">...</tspan><tspan> = (); let _: () = (); let _: () = (); let _: () = 42; let _: () = (); let _: () = (); let _: () = (); let _: () = (); let _: () </tspan><tspan class="fg-bright-blue bold">...</tspan>
-</tspan>
-    <tspan x="10px" y="100px"><tspan>   </tspan><tspan class="fg-bright-blue bold">|</tspan><tspan>                                                  </tspan><tspan class="fg-bright-red bold">^^</tspan><tspan>   </tspan><tspan class="fg-bright-red bold">^^</tspan><tspan> </tspan><tspan class="fg-bright-red bold">expected `()`, found integer</tspan>
-</tspan>
-    <tspan x="10px" y="118px"><tspan>   </tspan><tspan class="fg-bright-blue bold">|</tspan><tspan>                                                  </tspan><tspan class="fg-bright-red bold">|</tspan>
-</tspan>
-    <tspan x="10px" y="136px"><tspan>   </tspan><tspan class="fg-bright-blue bold">|</tspan><tspan>                                                  </tspan><tspan class="fg-bright-red bold">expected due to this</tspan>
-</tspan>
-    <tspan x="10px" y="154px"><tspan>   </tspan><tspan class="fg-bright-blue bold">|</tspan>
-</tspan>
-  </text>
-
-</svg>
diff --git a/tests/fixtures/deserialize.rs b/tests/fixtures/deserialize.rs
index a38a88e..3ddef79 100644
--- a/tests/fixtures/deserialize.rs
+++ b/tests/fixtures/deserialize.rs
@@ -151,8 +151,6 @@ pub struct RendererDef {
     anonymized_line_numbers: bool,
     #[serde(default)]
     term_width: Option<usize>,
-    #[serde(default)]
-    color: bool,
 }
 
 impl From<RendererDef> for Renderer {
@@ -160,15 +158,8 @@ impl From<RendererDef> for Renderer {
         let RendererDef {
             anonymized_line_numbers,
             term_width,
-            color,
         } = val;
-
-        let renderer = if color {
-            Renderer::styled()
-        } else {
-            Renderer::plain()
-        };
-        renderer
+        Renderer::plain()
             .anonymized_line_numbers(anonymized_line_numbers)
             .term_width(term_width.unwrap_or(DEFAULT_TERM_WIDTH))
     }
diff --git a/tests/fixtures/main.rs b/tests/fixtures/main.rs
index 07c69d8..81d0246 100644
--- a/tests/fixtures/main.rs
+++ b/tests/fixtures/main.rs
@@ -14,15 +14,7 @@ fn main() {
 }
 
 fn setup(input_path: std::path::PathBuf) -> tryfn::Case {
-    let parent = input_path
-        .parent()
-        .unwrap()
-        .file_name()
-        .unwrap()
-        .to_str()
-        .unwrap();
-    let file_name = input_path.file_name().unwrap().to_str().unwrap();
-    let name = format!("{}/{}", parent, file_name);
+    let name = input_path.file_name().unwrap().to_str().unwrap().to_owned();
     let expected = Data::read_from(&input_path.with_extension("svg"), None);
     tryfn::Case {
         name,
diff --git a/tests/fixtures/no-color/ann_eof.svg b/tests/fixtures/no-color/ann_eof.svg
new file mode 100644
index 0000000..c8900d0
--- /dev/null
+++ b/tests/fixtures/no-color/ann_eof.svg
@@ -0,0 +1,33 @@
+<svg width="740px" height="128px" xmlns="http://www.w3.org/2000/svg">
+  <style>
+    .fg { fill: #AAAAAA }
+    .bg { background: #000000 }
+    .container {
+      padding: 0 10px;
+      line-height: 18px;
+    }
+    tspan {
+      font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
+      white-space: pre;
+      line-height: 18px;
+    }
+  </style>
+
+  <rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
+
+  <text xml:space="preserve" class="container fg">
+    <tspan x="10px" y="28px"><tspan>error: expected `.`, `=`</tspan>
+</tspan>
+    <tspan x="10px" y="46px"><tspan> --&gt; Cargo.toml:1:5</tspan>
+</tspan>
+    <tspan x="10px" y="64px"><tspan>  |</tspan>
+</tspan>
+    <tspan x="10px" y="82px"><tspan>1 | asdf</tspan>
+</tspan>
+    <tspan x="10px" y="100px"><tspan>  |     ^</tspan>
+</tspan>
+    <tspan x="10px" y="118px"><tspan>  |</tspan>
+</tspan>
+  </text>
+
+</svg>
diff --git a/tests/fixtures/color/ann_eof.toml b/tests/fixtures/no-color/ann_eof.toml
similarity index 89%
rename from tests/fixtures/color/ann_eof.toml
rename to tests/fixtures/no-color/ann_eof.toml
index cee5f0f..313d220 100644
--- a/tests/fixtures/color/ann_eof.toml
+++ b/tests/fixtures/no-color/ann_eof.toml
@@ -10,6 +10,3 @@ origin = "Cargo.toml"
 label = ""
 level = "Error"
 range = [4, 4]
-
-[renderer]
-color = true
diff --git a/tests/fixtures/no-color/ann_insertion.svg b/tests/fixtures/no-color/ann_insertion.svg
new file mode 100644
index 0000000..b15b81b
--- /dev/null
+++ b/tests/fixtures/no-color/ann_insertion.svg
@@ -0,0 +1,33 @@
+<svg width="740px" height="128px" xmlns="http://www.w3.org/2000/svg">
+  <style>
+    .fg { fill: #AAAAAA }
+    .bg { background: #000000 }
+    .container {
+      padding: 0 10px;
+      line-height: 18px;
+    }
+    tspan {
+      font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
+      white-space: pre;
+      line-height: 18px;
+    }
+  </style>
+
+  <rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
+
+  <text xml:space="preserve" class="container fg">
+    <tspan x="10px" y="28px"><tspan>error: expected `.`, `=`</tspan>
+</tspan>
+    <tspan x="10px" y="46px"><tspan> --&gt; Cargo.toml:1:3</tspan>
+</tspan>
+    <tspan x="10px" y="64px"><tspan>  |</tspan>
+</tspan>
+    <tspan x="10px" y="82px"><tspan>1 | asf</tspan>
+</tspan>
+    <tspan x="10px" y="100px"><tspan>  |   ^ 'd' belongs here</tspan>
+</tspan>
+    <tspan x="10px" y="118px"><tspan>  |</tspan>
+</tspan>
+  </text>
+
+</svg>
diff --git a/tests/fixtures/color/ann_insertion.toml b/tests/fixtures/no-color/ann_insertion.toml
similarity index 89%
rename from tests/fixtures/color/ann_insertion.toml
rename to tests/fixtures/no-color/ann_insertion.toml
index bf7411e..ffd2140 100644
--- a/tests/fixtures/color/ann_insertion.toml
+++ b/tests/fixtures/no-color/ann_insertion.toml
@@ -10,6 +10,3 @@ origin = "Cargo.toml"
 label = "'d' belongs here"
 level = "Error"
 range = [2, 2]
-
-[renderer]
-color = true
diff --git a/tests/fixtures/no-color/ann_multiline.svg b/tests/fixtures/no-color/ann_multiline.svg
new file mode 100644
index 0000000..f4b4433
--- /dev/null
+++ b/tests/fixtures/no-color/ann_multiline.svg
@@ -0,0 +1,39 @@
+<svg width="740px" height="182px" xmlns="http://www.w3.org/2000/svg">
+  <style>
+    .fg { fill: #AAAAAA }
+    .bg { background: #000000 }
+    .container {
+      padding: 0 10px;
+      line-height: 18px;
+    }
+    tspan {
+      font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
+      white-space: pre;
+      line-height: 18px;
+    }
+  </style>
+
+  <rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
+
+  <text xml:space="preserve" class="container fg">
+    <tspan x="10px" y="28px"><tspan>error[E0027]: pattern does not mention fields `lineno`, `content`</tspan>
+</tspan>
+    <tspan x="10px" y="46px"><tspan>   --&gt; src/display_list.rs:139:32</tspan>
+</tspan>
+    <tspan x="10px" y="64px"><tspan>    |</tspan>
+</tspan>
+    <tspan x="10px" y="82px"><tspan>139 |                           if let DisplayLine::Source {</tspan>
+</tspan>
+    <tspan x="10px" y="100px"><tspan>    |  ________________________________^</tspan>
+</tspan>
+    <tspan x="10px" y="118px"><tspan>140 | |                             ref mut inline_marks,</tspan>
+</tspan>
+    <tspan x="10px" y="136px"><tspan>141 | |                         } = body[body_idx]</tspan>
+</tspan>
+    <tspan x="10px" y="154px"><tspan>    | |_________________________^ missing fields `lineno`, `content`</tspan>
+</tspan>
+    <tspan x="10px" y="172px"><tspan>    |</tspan>
+</tspan>
+  </text>
+
+</svg>
diff --git a/tests/fixtures/color/ann_multiline.toml b/tests/fixtures/no-color/ann_multiline.toml
similarity index 94%
rename from tests/fixtures/color/ann_multiline.toml
rename to tests/fixtures/no-color/ann_multiline.toml
index 9d8c30f..671b534 100644
--- a/tests/fixtures/color/ann_multiline.toml
+++ b/tests/fixtures/no-color/ann_multiline.toml
@@ -16,6 +16,3 @@ fold = false
 label = "missing fields `lineno`, `content`"
 level = "Error"
 range = [31, 128]
-
-[renderer]
-color = true
diff --git a/tests/fixtures/no-color/ann_multiline2.svg b/tests/fixtures/no-color/ann_multiline2.svg
new file mode 100644
index 0000000..18a9bf6
--- /dev/null
+++ b/tests/fixtures/no-color/ann_multiline2.svg
@@ -0,0 +1,39 @@
+<svg width="740px" height="182px" xmlns="http://www.w3.org/2000/svg">
+  <style>
+    .fg { fill: #AAAAAA }
+    .bg { background: #000000 }
+    .container {
+      padding: 0 10px;
+      line-height: 18px;
+    }
+    tspan {
+      font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
+      white-space: pre;
+      line-height: 18px;
+    }
+  </style>
+
+  <rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
+
+  <text xml:space="preserve" class="container fg">
+    <tspan x="10px" y="28px"><tspan>error[E####]: spacing error found</tspan>
+</tspan>
+    <tspan x="10px" y="46px"><tspan>  --&gt; foo.txt:26:12</tspan>
+</tspan>
+    <tspan x="10px" y="64px"><tspan>   |</tspan>
+</tspan>
+    <tspan x="10px" y="82px"><tspan>26 |   This is an exampl</tspan>
+</tspan>
+    <tspan x="10px" y="100px"><tspan>   |  ____________^</tspan>
+</tspan>
+    <tspan x="10px" y="118px"><tspan>27 | | e of an edge case of an annotation overflowing</tspan>
+</tspan>
+    <tspan x="10px" y="136px"><tspan>   | |_^ this should not be on separate lines</tspan>
+</tspan>
+    <tspan x="10px" y="154px"><tspan>28 |   to exactly one character on next line.</tspan>
+</tspan>
+    <tspan x="10px" y="172px"><tspan>   |</tspan>
+</tspan>
+  </text>
+
+</svg>
diff --git a/tests/fixtures/color/ann_multiline2.toml b/tests/fixtures/no-color/ann_multiline2.toml
similarity index 73%
rename from tests/fixtures/color/ann_multiline2.toml
rename to tests/fixtures/no-color/ann_multiline2.toml
index 259d94b..dd85332 100644
--- a/tests/fixtures/color/ann_multiline2.toml
+++ b/tests/fixtures/no-color/ann_multiline2.toml
@@ -5,8 +5,8 @@ title = "spacing error found"
 
 [[message.snippets]]
 source = """
-This is an example
-of an edge case of an annotation overflowing
+This is an exampl
+e of an edge case of an annotation overflowing
 to exactly one character on next line.
 """
 line_start = 26
@@ -15,7 +15,4 @@ fold = false
 [[message.snippets.annotations]]
 label = "this should not be on separate lines"
 level = "Error"
-range = [11, 19]
-
-[renderer]
-color = true
+range = [11, 18]
diff --git a/tests/fixtures/no-color/ann_removed_nl.svg b/tests/fixtures/no-color/ann_removed_nl.svg
new file mode 100644
index 0000000..c8900d0
--- /dev/null
+++ b/tests/fixtures/no-color/ann_removed_nl.svg
@@ -0,0 +1,33 @@
+<svg width="740px" height="128px" xmlns="http://www.w3.org/2000/svg">
+  <style>
+    .fg { fill: #AAAAAA }
+    .bg { background: #000000 }
+    .container {
+      padding: 0 10px;
+      line-height: 18px;
+    }
+    tspan {
+      font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
+      white-space: pre;
+      line-height: 18px;
+    }
+  </style>
+
+  <rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
+
+  <text xml:space="preserve" class="container fg">
+    <tspan x="10px" y="28px"><tspan>error: expected `.`, `=`</tspan>
+</tspan>
+    <tspan x="10px" y="46px"><tspan> --&gt; Cargo.toml:1:5</tspan>
+</tspan>
+    <tspan x="10px" y="64px"><tspan>  |</tspan>
+</tspan>
+    <tspan x="10px" y="82px"><tspan>1 | asdf</tspan>
+</tspan>
+    <tspan x="10px" y="100px"><tspan>  |     ^</tspan>
+</tspan>
+    <tspan x="10px" y="118px"><tspan>  |</tspan>
+</tspan>
+  </text>
+
+</svg>
diff --git a/tests/fixtures/color/ann_removed_nl.toml b/tests/fixtures/no-color/ann_removed_nl.toml
similarity index 89%
rename from tests/fixtures/color/ann_removed_nl.toml
rename to tests/fixtures/no-color/ann_removed_nl.toml
index 36f74ef..b681c29 100644
--- a/tests/fixtures/color/ann_removed_nl.toml
+++ b/tests/fixtures/no-color/ann_removed_nl.toml
@@ -10,6 +10,3 @@ origin = "Cargo.toml"
 label = ""
 level = "Error"
 range = [4, 5]
-
-[renderer]
-color = true
diff --git a/tests/fixtures/no-color/ensure-emoji-highlight-width.svg b/tests/fixtures/no-color/ensure-emoji-highlight-width.svg
new file mode 100644
index 0000000..0840805
--- /dev/null
+++ b/tests/fixtures/no-color/ensure-emoji-highlight-width.svg
@@ -0,0 +1,33 @@
+<svg width="1356px" height="128px" xmlns="http://www.w3.org/2000/svg">
+  <style>
+    .fg { fill: #AAAAAA }
+    .bg { background: #000000 }
+    .container {
+      padding: 0 10px;
+      line-height: 18px;
+    }
+    tspan {
+      font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
+      white-space: pre;
+      line-height: 18px;
+    }
+  </style>
+
+  <rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
+
+  <text xml:space="preserve" class="container fg">
+    <tspan x="10px" y="28px"><tspan>error: invalid character ` ` in package name: `haha this isn't a valid name 🐛`, characters must be Unicode XID characters (numbers, `-`, `_`, or most letters)</tspan>
+</tspan>
+    <tspan x="10px" y="46px"><tspan> --&gt; &lt;file&gt;:7:1</tspan>
+</tspan>
+    <tspan x="10px" y="64px"><tspan>  |</tspan>
+</tspan>
+    <tspan x="10px" y="82px"><tspan>7 | "haha this isn't a valid name 🐛" = { package = "libc", version = "0.1" }</tspan>
+</tspan>
+    <tspan x="10px" y="100px"><tspan>  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</tspan>
+</tspan>
+    <tspan x="10px" y="118px"><tspan>  |</tspan>
+</tspan>
+  </text>
+
+</svg>
diff --git a/tests/fixtures/color/ensure-emoji-highlight-width.toml b/tests/fixtures/no-color/ensure-emoji-highlight-width.toml
similarity index 94%
rename from tests/fixtures/color/ensure-emoji-highlight-width.toml
rename to tests/fixtures/no-color/ensure-emoji-highlight-width.toml
index 52168b4..7af05ff 100644
--- a/tests/fixtures/color/ensure-emoji-highlight-width.toml
+++ b/tests/fixtures/no-color/ensure-emoji-highlight-width.toml
@@ -13,6 +13,3 @@ origin = "<file>"
 label = ""
 level = "Error"
 range = [0, 35]
-
-[renderer]
-color = true
diff --git a/tests/fixtures/no-color/fold_ann_multiline.svg b/tests/fixtures/no-color/fold_ann_multiline.svg
new file mode 100644
index 0000000..0d2d67c
--- /dev/null
+++ b/tests/fixtures/no-color/fold_ann_multiline.svg
@@ -0,0 +1,43 @@
+<svg width="869px" height="218px" xmlns="http://www.w3.org/2000/svg">
+  <style>
+    .fg { fill: #AAAAAA }
+    .bg { background: #000000 }
+    .container {
+      padding: 0 10px;
+      line-height: 18px;
+    }
+    tspan {
+      font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
+      white-space: pre;
+      line-height: 18px;
+    }
+  </style>
+
+  <rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
+
+  <text xml:space="preserve" class="container fg">
+    <tspan x="10px" y="28px"><tspan>error[E0308]: mismatched types</tspan>
+</tspan>
+    <tspan x="10px" y="46px"><tspan>  --&gt; src/format.rs:51:6</tspan>
+</tspan>
+    <tspan x="10px" y="64px"><tspan>   |</tspan>
+</tspan>
+    <tspan x="10px" y="82px"><tspan>51 |   ) -&gt; Option&lt;String&gt; {</tspan>
+</tspan>
+    <tspan x="10px" y="100px"><tspan>   |        -------------- expected `std::option::Option&lt;std::string::String&gt;` because of return type</tspan>
+</tspan>
+    <tspan x="10px" y="118px"><tspan>52 | /     for ann in annotations {</tspan>
+</tspan>
+    <tspan x="10px" y="136px"><tspan>...  |</tspan>
+</tspan>
+    <tspan x="10px" y="154px"><tspan>71 | |         }</tspan>
+</tspan>
+    <tspan x="10px" y="172px"><tspan>72 | |     }</tspan>
+</tspan>
+    <tspan x="10px" y="190px"><tspan>   | |_____^ expected enum `std::option::Option`, found ()</tspan>
+</tspan>
+    <tspan x="10px" y="208px"><tspan>   |</tspan>
+</tspan>
+  </text>
+
+</svg>
diff --git a/tests/fixtures/color/fold_ann_multiline.toml b/tests/fixtures/no-color/fold_ann_multiline.toml
similarity index 97%
rename from tests/fixtures/color/fold_ann_multiline.toml
rename to tests/fixtures/no-color/fold_ann_multiline.toml
index 80edfb5..09fc7d4 100644
--- a/tests/fixtures/color/fold_ann_multiline.toml
+++ b/tests/fixtures/no-color/fold_ann_multiline.toml
@@ -39,6 +39,3 @@ range = [5, 19]
 label = "expected enum `std::option::Option`, found ()"
 level = "Error"
 range = [22, 766]
-
-[renderer]
-color = true
diff --git a/tests/fixtures/no-color/fold_bad_origin_line.svg b/tests/fixtures/no-color/fold_bad_origin_line.svg
new file mode 100644
index 0000000..13a0834
--- /dev/null
+++ b/tests/fixtures/no-color/fold_bad_origin_line.svg
@@ -0,0 +1,33 @@
+<svg width="740px" height="128px" xmlns="http://www.w3.org/2000/svg">
+  <style>
+    .fg { fill: #AAAAAA }
+    .bg { background: #000000 }
+    .container {
+      padding: 0 10px;
+      line-height: 18px;
+    }
+    tspan {
+      font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
+      white-space: pre;
+      line-height: 18px;
+    }
+  </style>
+
+  <rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
+
+  <text xml:space="preserve" class="container fg">
+    <tspan x="10px" y="28px"><tspan>error</tspan>
+</tspan>
+    <tspan x="10px" y="46px"><tspan> --&gt; path/to/error.rs:3:1</tspan>
+</tspan>
+    <tspan x="10px" y="64px"><tspan>  |</tspan>
+</tspan>
+    <tspan x="10px" y="82px"><tspan>3 | invalid syntax</tspan>
+</tspan>
+    <tspan x="10px" y="100px"><tspan>  | -------------- error here</tspan>
+</tspan>
+    <tspan x="10px" y="118px"><tspan>  |</tspan>
+</tspan>
+  </text>
+
+</svg>
diff --git a/tests/fixtures/color/fold_bad_origin_line.toml b/tests/fixtures/no-color/fold_bad_origin_line.toml
similarity index 90%
rename from tests/fixtures/color/fold_bad_origin_line.toml
rename to tests/fixtures/no-color/fold_bad_origin_line.toml
index 3e40137..1e81a71 100644
--- a/tests/fixtures/color/fold_bad_origin_line.toml
+++ b/tests/fixtures/no-color/fold_bad_origin_line.toml
@@ -15,6 +15,3 @@ fold = true
 label = "error here"
 level = "Warning"
 range = [2,16]
-
-[renderer]
-color = true
diff --git a/tests/fixtures/no-color/fold_leading.svg b/tests/fixtures/no-color/fold_leading.svg
new file mode 100644
index 0000000..72887a2
--- /dev/null
+++ b/tests/fixtures/no-color/fold_leading.svg
@@ -0,0 +1,33 @@
+<svg width="740px" height="128px" xmlns="http://www.w3.org/2000/svg">
+  <style>
+    .fg { fill: #AAAAAA }
+    .bg { background: #000000 }
+    .container {
+      padding: 0 10px;
+      line-height: 18px;
+    }
+    tspan {
+      font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
+      white-space: pre;
+      line-height: 18px;
+    }
+  </style>
+
+  <rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
+
+  <text xml:space="preserve" class="container fg">
+    <tspan x="10px" y="28px"><tspan>error[E0308]: invalid type: integer `20`, expected a bool</tspan>
+</tspan>
+    <tspan x="10px" y="46px"><tspan>  --&gt; Cargo.toml:11:13</tspan>
+</tspan>
+    <tspan x="10px" y="64px"><tspan>   |</tspan>
+</tspan>
+    <tspan x="10px" y="82px"><tspan>11 | workspace = 20</tspan>
+</tspan>
+    <tspan x="10px" y="100px"><tspan>   |             ^^</tspan>
+</tspan>
+    <tspan x="10px" y="118px"><tspan>   |</tspan>
+</tspan>
+  </text>
+
+</svg>
diff --git a/tests/fixtures/color/fold_leading.toml b/tests/fixtures/no-color/fold_leading.toml
similarity index 94%
rename from tests/fixtures/color/fold_leading.toml
rename to tests/fixtures/no-color/fold_leading.toml
index 90c6c8c..e3fc696 100644
--- a/tests/fixtures/color/fold_leading.toml
+++ b/tests/fixtures/no-color/fold_leading.toml
@@ -24,6 +24,3 @@ fold = true
 label = ""
 level = "Error"
 range = [132, 134]
-
-[renderer]
-color = true
diff --git a/tests/fixtures/no-color/fold_trailing.svg b/tests/fixtures/no-color/fold_trailing.svg
new file mode 100644
index 0000000..15c9850
--- /dev/null
+++ b/tests/fixtures/no-color/fold_trailing.svg
@@ -0,0 +1,33 @@
+<svg width="740px" height="128px" xmlns="http://www.w3.org/2000/svg">
+  <style>
+    .fg { fill: #AAAAAA }
+    .bg { background: #000000 }
+    .container {
+      padding: 0 10px;
+      line-height: 18px;
+    }
+    tspan {
+      font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
+      white-space: pre;
+      line-height: 18px;
+    }
+  </style>
+
+  <rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
+
+  <text xml:space="preserve" class="container fg">
+    <tspan x="10px" y="28px"><tspan>error[E0308]: invalid type: integer `20`, expected a lints table</tspan>
+</tspan>
+    <tspan x="10px" y="46px"><tspan> --&gt; Cargo.toml:1:9</tspan>
+</tspan>
+    <tspan x="10px" y="64px"><tspan>  |</tspan>
+</tspan>
+    <tspan x="10px" y="82px"><tspan>1 | lints = 20</tspan>
+</tspan>
+    <tspan x="10px" y="100px"><tspan>  |         ^^</tspan>
+</tspan>
+    <tspan x="10px" y="118px"><tspan>  |</tspan>
+</tspan>
+  </text>
+
+</svg>
diff --git a/tests/fixtures/color/fold_trailing.toml b/tests/fixtures/no-color/fold_trailing.toml
similarity index 93%
rename from tests/fixtures/color/fold_trailing.toml
rename to tests/fixtures/no-color/fold_trailing.toml
index 10b2240..8ee4c05 100644
--- a/tests/fixtures/color/fold_trailing.toml
+++ b/tests/fixtures/no-color/fold_trailing.toml
@@ -23,6 +23,3 @@ fold = true
 label = ""
 level = "Error"
 range = [8, 10]
-
-[renderer]
-color = true
diff --git a/tests/fixtures/no-color/issue_9.svg b/tests/fixtures/no-color/issue_9.svg
new file mode 100644
index 0000000..af22d82
--- /dev/null
+++ b/tests/fixtures/no-color/issue_9.svg
@@ -0,0 +1,45 @@
+<svg width="911px" height="236px" xmlns="http://www.w3.org/2000/svg">
+  <style>
+    .fg { fill: #AAAAAA }
+    .bg { background: #000000 }
+    .container {
+      padding: 0 10px;
+      line-height: 18px;
+    }
+    tspan {
+      font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
+      white-space: pre;
+      line-height: 18px;
+    }
+  </style>
+
+  <rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
+
+  <text xml:space="preserve" class="container fg">
+    <tspan x="10px" y="28px"><tspan>error: expected one of `.`, `;`, `?`, or an operator, found `for`</tspan>
+</tspan>
+    <tspan x="10px" y="46px"><tspan> --&gt; /code/rust/src/test/ui/annotate-snippet/suggestion.rs:4:5</tspan>
+</tspan>
+    <tspan x="10px" y="64px"><tspan>  |</tspan>
+</tspan>
+    <tspan x="10px" y="82px"><tspan>4 | let x = vec![1];</tspan>
+</tspan>
+    <tspan x="10px" y="100px"><tspan>  |     - move occurs because `x` has type `std::vec::Vec&lt;i32&gt;`, which does not implement the `Copy` trait</tspan>
+</tspan>
+    <tspan x="10px" y="118px"><tspan>  |</tspan>
+</tspan>
+    <tspan x="10px" y="136px"><tspan>7 | let y = x;</tspan>
+</tspan>
+    <tspan x="10px" y="154px"><tspan>  |         - value moved here</tspan>
+</tspan>
+    <tspan x="10px" y="172px"><tspan>  |</tspan>
+</tspan>
+    <tspan x="10px" y="190px"><tspan>9 | x;</tspan>
+</tspan>
+    <tspan x="10px" y="208px"><tspan>  | ^ value used here after move</tspan>
+</tspan>
+    <tspan x="10px" y="226px"><tspan>  |</tspan>
+</tspan>
+  </text>
+
+</svg>
diff --git a/tests/fixtures/color/issue_9.toml b/tests/fixtures/no-color/issue_9.toml
similarity index 96%
rename from tests/fixtures/color/issue_9.toml
rename to tests/fixtures/no-color/issue_9.toml
index 9de1753..1f35243 100644
--- a/tests/fixtures/color/issue_9.toml
+++ b/tests/fixtures/no-color/issue_9.toml
@@ -26,6 +26,3 @@ line_start = 9
 label = "value used here after move"
 level = "Error"
 range = [0, 1]
-
-[renderer]
-color = true
diff --git a/tests/fixtures/no-color/multiple_annotations.svg b/tests/fixtures/no-color/multiple_annotations.svg
new file mode 100644
index 0000000..18bca93
--- /dev/null
+++ b/tests/fixtures/no-color/multiple_annotations.svg
@@ -0,0 +1,51 @@
+<svg width="768px" height="290px" xmlns="http://www.w3.org/2000/svg">
+  <style>
+    .fg { fill: #AAAAAA }
+    .bg { background: #000000 }
+    .container {
+      padding: 0 10px;
+      line-height: 18px;
+    }
+    tspan {
+      font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
+      white-space: pre;
+      line-height: 18px;
+    }
+  </style>
+
+  <rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
+
+  <text xml:space="preserve" class="container fg">
+    <tspan x="10px" y="28px"><tspan>error</tspan>
+</tspan>
+    <tspan x="10px" y="46px"><tspan>    |</tspan>
+</tspan>
+    <tspan x="10px" y="64px"><tspan> 96 | fn add_title_line(result: &amp;mut Vec&lt;String&gt;, main_annotation: Option&lt;&amp;Annotation&gt;) {</tspan>
+</tspan>
+    <tspan x="10px" y="82px"><tspan> 97 |     if let Some(annotation) = main_annotation {</tspan>
+</tspan>
+    <tspan x="10px" y="100px"><tspan>    |                 ^^^^^^^^^^ Variable defined here</tspan>
+</tspan>
+    <tspan x="10px" y="118px"><tspan> 98 |         result.push(format_title_line(</tspan>
+</tspan>
+    <tspan x="10px" y="136px"><tspan> 99 |             &amp;annotation.annotation_type,</tspan>
+</tspan>
+    <tspan x="10px" y="154px"><tspan>    |              ^^^^^^^^^^ Referenced here</tspan>
+</tspan>
+    <tspan x="10px" y="172px"><tspan>100 |             None,</tspan>
+</tspan>
+    <tspan x="10px" y="190px"><tspan>101 |             &amp;annotation.label,</tspan>
+</tspan>
+    <tspan x="10px" y="208px"><tspan>    |              ^^^^^^^^^^ Referenced again here</tspan>
+</tspan>
+    <tspan x="10px" y="226px"><tspan>102 |         ));</tspan>
+</tspan>
+    <tspan x="10px" y="244px"><tspan>103 |     }</tspan>
+</tspan>
+    <tspan x="10px" y="262px"><tspan>104 | }</tspan>
+</tspan>
+    <tspan x="10px" y="280px"><tspan>    |</tspan>
+</tspan>
+  </text>
+
+</svg>
diff --git a/tests/fixtures/color/multiple_annotations.toml b/tests/fixtures/no-color/multiple_annotations.toml
similarity index 96%
rename from tests/fixtures/color/multiple_annotations.toml
rename to tests/fixtures/no-color/multiple_annotations.toml
index 824c530..842b137 100644
--- a/tests/fixtures/color/multiple_annotations.toml
+++ b/tests/fixtures/no-color/multiple_annotations.toml
@@ -27,6 +27,3 @@ range = [184, 194]
 label = "Referenced again here"
 level = "Error"
 range = [243, 253]
-
-[renderer]
-color = true
diff --git a/tests/fixtures/no-color/simple.svg b/tests/fixtures/no-color/simple.svg
new file mode 100644
index 0000000..51a3a65
--- /dev/null
+++ b/tests/fixtures/no-color/simple.svg
@@ -0,0 +1,39 @@
+<svg width="740px" height="182px" xmlns="http://www.w3.org/2000/svg">
+  <style>
+    .fg { fill: #AAAAAA }
+    .bg { background: #000000 }
+    .container {
+      padding: 0 10px;
+      line-height: 18px;
+    }
+    tspan {
+      font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
+      white-space: pre;
+      line-height: 18px;
+    }
+  </style>
+
+  <rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
+
+  <text xml:space="preserve" class="container fg">
+    <tspan x="10px" y="28px"><tspan>error: expected one of `.`, `;`, `?`, or an operator, found `for`</tspan>
+</tspan>
+    <tspan x="10px" y="46px"><tspan>   --&gt; src/format_color.rs:171:9</tspan>
+</tspan>
+    <tspan x="10px" y="64px"><tspan>    |</tspan>
+</tspan>
+    <tspan x="10px" y="82px"><tspan>169 |         })</tspan>
+</tspan>
+    <tspan x="10px" y="100px"><tspan>    |           - expected one of `.`, `;`, `?`, or an operator here</tspan>
+</tspan>
+    <tspan x="10px" y="118px"><tspan>170 | </tspan>
+</tspan>
+    <tspan x="10px" y="136px"><tspan>171 |         for line in &amp;self.body {</tspan>
+</tspan>
+    <tspan x="10px" y="154px"><tspan>    |         ^^^ unexpected token</tspan>
+</tspan>
+    <tspan x="10px" y="172px"><tspan>    |</tspan>
+</tspan>
+  </text>
+
+</svg>
diff --git a/tests/fixtures/color/simple.toml b/tests/fixtures/no-color/simple.toml
similarity index 94%
rename from tests/fixtures/color/simple.toml
rename to tests/fixtures/no-color/simple.toml
index 2e6969f..76b5bac 100644
--- a/tests/fixtures/color/simple.toml
+++ b/tests/fixtures/no-color/simple.toml
@@ -17,6 +17,3 @@ range = [20, 23]
 label = "expected one of `.`, `;`, `?`, or an operator here"
 level = "Warning"
 range = [10, 11]
-
-[renderer]
-color = true
diff --git a/tests/fixtures/no-color/strip_line.svg b/tests/fixtures/no-color/strip_line.svg
new file mode 100644
index 0000000..b1fd8a6
--- /dev/null
+++ b/tests/fixtures/no-color/strip_line.svg
@@ -0,0 +1,33 @@
+<svg width="740px" height="128px" xmlns="http://www.w3.org/2000/svg">
+  <style>
+    .fg { fill: #AAAAAA }
+    .bg { background: #000000 }
+    .container {
+      padding: 0 10px;
+      line-height: 18px;
+    }
+    tspan {
+      font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
+      white-space: pre;
+      line-height: 18px;
+    }
+  </style>
+
+  <rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
+
+  <text xml:space="preserve" class="container fg">
+    <tspan x="10px" y="28px"><tspan>error[E0308]: mismatched types</tspan>
+</tspan>
+    <tspan x="10px" y="46px"><tspan>  --&gt; $DIR/whitespace-trimming.rs:4:193</tspan>
+</tspan>
+    <tspan x="10px" y="64px"><tspan>   |</tspan>
+</tspan>
+    <tspan x="10px" y="82px"><tspan>LL | ...                   let _: () = 42;</tspan>
+</tspan>
+    <tspan x="10px" y="100px"><tspan>   |                                   ^^ expected (), found integer</tspan>
+</tspan>
+    <tspan x="10px" y="118px"><tspan>   |</tspan>
+</tspan>
+  </text>
+
+</svg>
diff --git a/tests/fixtures/color/strip_line.toml b/tests/fixtures/no-color/strip_line.toml
similarity index 97%
rename from tests/fixtures/color/strip_line.toml
rename to tests/fixtures/no-color/strip_line.toml
index 546c96a..459cbe1 100644
--- a/tests/fixtures/color/strip_line.toml
+++ b/tests/fixtures/no-color/strip_line.toml
@@ -14,5 +14,5 @@ level = "Error"
 range = [192, 194]
 
 [renderer]
-color = true
+color = false
 anonymized_line_numbers = true
diff --git a/tests/fixtures/no-color/strip_line_char.svg b/tests/fixtures/no-color/strip_line_char.svg
new file mode 100644
index 0000000..15296a1
--- /dev/null
+++ b/tests/fixtures/no-color/strip_line_char.svg
@@ -0,0 +1,33 @@
+<svg width="740px" height="128px" xmlns="http://www.w3.org/2000/svg">
+  <style>
+    .fg { fill: #AAAAAA }
+    .bg { background: #000000 }
+    .container {
+      padding: 0 10px;
+      line-height: 18px;
+    }
+    tspan {
+      font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
+      white-space: pre;
+      line-height: 18px;
+    }
+  </style>
+
+  <rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
+
+  <text xml:space="preserve" class="container fg">
+    <tspan x="10px" y="28px"><tspan>error[E0308]: mismatched types</tspan>
+</tspan>
+    <tspan x="10px" y="46px"><tspan>  --&gt; $DIR/whitespace-trimming.rs:4:193</tspan>
+</tspan>
+    <tspan x="10px" y="64px"><tspan>   |</tspan>
+</tspan>
+    <tspan x="10px" y="82px"><tspan>LL | ...                   let _: () = 42ñ</tspan>
+</tspan>
+    <tspan x="10px" y="100px"><tspan>   |                                   ^^ expected (), found integer</tspan>
+</tspan>
+    <tspan x="10px" y="118px"><tspan>   |</tspan>
+</tspan>
+  </text>
+
+</svg>
diff --git a/tests/fixtures/color/strip_line_char.toml b/tests/fixtures/no-color/strip_line_char.toml
similarity index 97%
rename from tests/fixtures/color/strip_line_char.toml
rename to tests/fixtures/no-color/strip_line_char.toml
index 863abb3..dedefd5 100644
--- a/tests/fixtures/color/strip_line_char.toml
+++ b/tests/fixtures/no-color/strip_line_char.toml
@@ -14,5 +14,5 @@ level = "Error"
 range = [192, 194]
 
 [renderer]
-color = true
+color = false
 anonymized_line_numbers = true
diff --git a/tests/fixtures/no-color/strip_line_non_ws.svg b/tests/fixtures/no-color/strip_line_non_ws.svg
new file mode 100644
index 0000000..2be3890
--- /dev/null
+++ b/tests/fixtures/no-color/strip_line_non_ws.svg
@@ -0,0 +1,35 @@
+<svg width="1196px" height="146px" xmlns="http://www.w3.org/2000/svg">
+  <style>
+    .fg { fill: #AAAAAA }
+    .bg { background: #000000 }
+    .container {
+      padding: 0 10px;
+      line-height: 18px;
+    }
+    tspan {
+      font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
+      white-space: pre;
+      line-height: 18px;
+    }
+  </style>
+
+  <rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
+
+  <text xml:space="preserve" class="container fg">
+    <tspan x="10px" y="28px"><tspan>error[E0308]: mismatched types</tspan>
+</tspan>
+    <tspan x="10px" y="46px"><tspan>  --&gt; $DIR/non-whitespace-trimming.rs:4:242</tspan>
+</tspan>
+    <tspan x="10px" y="64px"><tspan>   |</tspan>
+</tspan>
+    <tspan x="10px" y="82px"><tspan>LL | ... = (); let _: () = (); let _: () = (); let _: () = 42; let _: () = (); let _: () = (); let _: () = (); let _: () = (); let _: () ...</tspan>
+</tspan>
+    <tspan x="10px" y="100px"><tspan>   |                                                       ^^ expected `()`, found integer</tspan>
+</tspan>
+    <tspan x="10px" y="118px"><tspan>   |                                                  ^^ expected due to this</tspan>
+</tspan>
+    <tspan x="10px" y="136px"><tspan>   |</tspan>
+</tspan>
+  </text>
+
+</svg>
diff --git a/tests/fixtures/color/strip_line_non_ws.toml b/tests/fixtures/no-color/strip_line_non_ws.toml
similarity index 98%
rename from tests/fixtures/color/strip_line_non_ws.toml
rename to tests/fixtures/no-color/strip_line_non_ws.toml
index c6573ff..06ecad8 100644
--- a/tests/fixtures/color/strip_line_non_ws.toml
+++ b/tests/fixtures/no-color/strip_line_non_ws.toml
@@ -23,4 +23,3 @@ range = [236, 238]
 
 [renderer]
 anonymized_line_numbers = true
-color = true
diff --git a/tests/formatter.rs b/tests/formatter.rs
index 7f914de..5b746e1 100644
--- a/tests/formatter.rs
+++ b/tests/formatter.rs
@@ -262,10 +262,8 @@ fn test_source_annotation_standalone_multiline() {
 error
   |
 1 | tests
-  | -----
-  | |
-  | help: Example string
-  | help: Second line
+  | ----- help: Example string
+  | ----- help: Second line
   |
 "#]];
     let renderer = Renderer::plain();
@@ -298,610 +296,10 @@ error
    |
 LL | This is an example
 LL | of content lines
-LL |
+LL | 
 LL | abc
    |
 "#]];
     let renderer = Renderer::plain().anonymized_line_numbers(true);
     assert_data_eq!(renderer.render(input).to_string(), expected);
 }
-
-#[test]
-fn issue_130() {
-    let input = Level::Error.title("dummy").snippet(
-        Snippet::source("foo\nbar\nbaz")
-            .origin("file/path")
-            .line_start(3)
-            .fold(true)
-            .annotation(Level::Error.span(4..11)), // bar\nbaz
-    );
-
-    let expected = str![[r#"
-error: dummy
- --> file/path:4:1
-  |
-4 | / bar
-5 | | baz
-  | |___^
-  |
-"#]];
-    let renderer = Renderer::plain();
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-
-#[test]
-fn unterminated_string_multiline() {
-    let source = "\
-a\"
-// ...
-";
-    let input = Level::Error.title("").snippet(
-        Snippet::source(source)
-            .origin("file/path")
-            .line_start(3)
-            .fold(true)
-            .annotation(Level::Error.span(0..10)), // 1..10 works
-    );
-    let expected = str![[r#"
-error
- --> file/path:3:1
-  |
-3 | / a"
-4 | | // ...
-  | |_______^
-  |
-"#]];
-    let renderer = Renderer::plain().anonymized_line_numbers(false);
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-
-#[test]
-fn char_and_nl_annotate_char() {
-    let source = "a\r\nb";
-    let input = Level::Error.title("").snippet(
-        Snippet::source(source)
-            .origin("file/path")
-            .line_start(3)
-            .annotation(Level::Error.span(0..2)), // a\r
-    );
-    let expected = str![[r#"
-error
- --> file/path:3:1
-  |
-3 | a
-  | ^
-4 | b
-  |"#]];
-    let renderer = Renderer::plain().anonymized_line_numbers(false);
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-
-#[test]
-fn char_eol_annotate_char() {
-    let source = "a\r\nb";
-    let input = Level::Error.title("").snippet(
-        Snippet::source(source)
-            .origin("file/path")
-            .line_start(3)
-            .annotation(Level::Error.span(0..3)), // a\r\n
-    );
-    let expected = str![[r#"
-error
- --> file/path:3:1
-  |
-3 | a
-  | ^
-4 | b
-  |"#]];
-    let renderer = Renderer::plain().anonymized_line_numbers(false);
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-
-#[test]
-fn char_eol_annotate_char_double_width() {
-    let snippets = Level::Error.title("").snippet(
-        Snippet::source("こん\r\nにちは\r\n世界")
-            .origin("<current file>")
-            .annotation(Level::Error.span(3..8)), // ん\r\n
-    );
-
-    let expected = str![[r#"
-error
- --> <current file>:1:2
-  |
-1 | こん
-  |   ^^
-2 | にちは
-3 | 世界
-  |
-"#]];
-
-    let renderer = Renderer::plain();
-    assert_data_eq!(renderer.render(snippets).to_string(), expected);
-}
-
-#[test]
-fn annotate_eol() {
-    let source = "a\r\nb";
-    let input = Level::Error.title("").snippet(
-        Snippet::source(source)
-            .origin("file/path")
-            .line_start(3)
-            .annotation(Level::Error.span(1..2)), // \r
-    );
-    let expected = str![[r#"
-error
- --> file/path:3:2
-  |
-3 | a
-  |  ^
-4 | b
-  |"#]];
-    let renderer = Renderer::plain().anonymized_line_numbers(false);
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-
-#[test]
-fn annotate_eol2() {
-    let source = "a\r\nb";
-    let input = Level::Error.title("").snippet(
-        Snippet::source(source)
-            .origin("file/path")
-            .line_start(3)
-            .annotation(Level::Error.span(1..3)), // \r\n
-    );
-    let expected = str![[r#"
-error
- --> file/path:3:2
-  |
-3 | a
-  |  ^
-4 | b
-  |"#]];
-    let renderer = Renderer::plain().anonymized_line_numbers(false);
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-
-#[test]
-fn annotate_eol3() {
-    let source = "a\r\nb";
-    let input = Level::Error.title("").snippet(
-        Snippet::source(source)
-            .origin("file/path")
-            .line_start(3)
-            .annotation(Level::Error.span(2..3)), // \n
-    );
-    let expected = str![[r#"
-error
- --> file/path:3:2
-  |
-3 | a
-  |  ^
-4 | b
-  |"#]];
-    let renderer = Renderer::plain().anonymized_line_numbers(false);
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-
-#[test]
-fn annotate_eol4() {
-    let source = "a\r\nb";
-    let input = Level::Error.title("").snippet(
-        Snippet::source(source)
-            .origin("file/path")
-            .line_start(3)
-            .annotation(Level::Error.span(2..2)), // \n
-    );
-    let expected = str![[r#"
-error
- --> file/path:3:2
-  |
-3 | a
-  |  ^
-4 | b
-  |"#]];
-    let renderer = Renderer::plain().anonymized_line_numbers(false);
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-
-#[test]
-fn annotate_eol_double_width() {
-    let snippets = Level::Error.title("").snippet(
-        Snippet::source("こん\r\nにちは\r\n世界")
-            .origin("<current file>")
-            .annotation(Level::Error.span(7..8)), // \n
-    );
-
-    let expected = str![[r#"
-error
- --> <current file>:1:3
-  |
-1 | こん
-  |     ^
-2 | にちは
-3 | 世界
-  |
-"#]];
-
-    let renderer = Renderer::plain();
-    assert_data_eq!(renderer.render(snippets).to_string(), expected);
-}
-
-#[test]
-fn multiline_eol_start() {
-    let source = "a\r\nb";
-    let input = Level::Error.title("").snippet(
-        Snippet::source(source)
-            .origin("file/path")
-            .line_start(3)
-            .annotation(Level::Error.span(1..4)), // \r\nb
-    );
-    let expected = str![[r#"
-error
- --> file/path:3:2
-  |
-3 |   a
-  |  __^
-4 | | b
-  | |_^
-  |"#]];
-    let renderer = Renderer::plain().anonymized_line_numbers(false);
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-
-#[test]
-fn multiline_eol_start2() {
-    let source = "a\r\nb";
-    let input = Level::Error.title("").snippet(
-        Snippet::source(source)
-            .origin("file/path")
-            .line_start(3)
-            .annotation(Level::Error.span(2..4)), // \nb
-    );
-    let expected = str![[r#"
-error
- --> file/path:3:2
-  |
-3 |   a
-  |  __^
-4 | | b
-  | |_^
-  |"#]];
-    let renderer = Renderer::plain().anonymized_line_numbers(false);
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-
-#[test]
-fn multiline_eol_start3() {
-    let source = "a\nb";
-    let input = Level::Error.title("").snippet(
-        Snippet::source(source)
-            .origin("file/path")
-            .line_start(3)
-            .annotation(Level::Error.span(1..3)), // \nb
-    );
-    let expected = str![[r#"
-error
- --> file/path:3:2
-  |
-3 |   a
-  |  __^
-4 | | b
-  | |_^
-  |"#]];
-    let renderer = Renderer::plain().anonymized_line_numbers(false);
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-
-#[test]
-fn multiline_eol_start_double_width() {
-    let snippets = Level::Error.title("").snippet(
-        Snippet::source("こん\r\nにちは\r\n世界")
-            .origin("<current file>")
-            .annotation(Level::Error.span(7..11)), // \r\nに
-    );
-
-    let expected = str![[r#"
-error
- --> <current file>:1:3
-  |
-1 |   こん
-  |  _____^
-2 | | にちは
-  | |__^
-3 |   世界
-  |
-"#]];
-
-    let renderer = Renderer::plain();
-    assert_data_eq!(renderer.render(snippets).to_string(), expected);
-}
-
-#[test]
-fn multiline_eol_start_eol_end() {
-    let source = "a\nb\nc";
-    let input = Level::Error.title("").snippet(
-        Snippet::source(source)
-            .origin("file/path")
-            .line_start(3)
-            .annotation(Level::Error.span(1..4)), // \nb\n
-    );
-    let expected = str![[r#"
-error
- --> file/path:3:2
-  |
-3 |   a
-  |  __^
-4 | | b
-  | |__^
-5 |   c
-  |
-"#]];
-    let renderer = Renderer::plain().anonymized_line_numbers(false);
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-
-#[test]
-fn multiline_eol_start_eol_end2() {
-    let source = "a\r\nb\r\nc";
-    let input = Level::Error.title("").snippet(
-        Snippet::source(source)
-            .origin("file/path")
-            .line_start(3)
-            .annotation(Level::Error.span(2..5)), // \nb\r
-    );
-    let expected = str![[r#"
-error
- --> file/path:3:2
-  |
-3 |   a
-  |  __^
-4 | | b
-  | |__^
-5 |   c
-  |
-"#]];
-    let renderer = Renderer::plain().anonymized_line_numbers(false);
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-
-#[test]
-fn multiline_eol_start_eol_end3() {
-    let source = "a\r\nb\r\nc";
-    let input = Level::Error.title("").snippet(
-        Snippet::source(source)
-            .origin("file/path")
-            .line_start(3)
-            .annotation(Level::Error.span(2..6)), // \nb\r\n
-    );
-    let expected = str![[r#"
-error
- --> file/path:3:2
-  |
-3 |   a
-  |  __^
-4 | | b
-  | |__^
-5 |   c
-  |
-"#]];
-    let renderer = Renderer::plain().anonymized_line_numbers(false);
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-
-#[test]
-fn multiline_eol_start_eof_end() {
-    let source = "a\r\nb";
-    let input = Level::Error.title("").snippet(
-        Snippet::source(source)
-            .origin("file/path")
-            .line_start(3)
-            .annotation(Level::Error.span(1..5)), // \r\nb(EOF)
-    );
-    let expected = str![[r#"
-error
- --> file/path:3:2
-  |
-3 |   a
-  |  __^
-4 | | b
-  | |__^
-  |
-"#]];
-    let renderer = Renderer::plain().anonymized_line_numbers(false);
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-
-#[test]
-fn multiline_eol_start_eof_end_double_width() {
-    let source = "ん\r\nに";
-    let input = Level::Error.title("").snippet(
-        Snippet::source(source)
-            .origin("file/path")
-            .line_start(3)
-            .annotation(Level::Error.span(3..9)), // \r\nに(EOF)
-    );
-    let expected = str![[r#"
-error
- --> file/path:3:2
-  |
-3 |   ん
-  |  ___^
-4 | | に
-  | |___^
-  |
-"#]];
-    let renderer = Renderer::plain().anonymized_line_numbers(false);
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-
-#[test]
-fn two_single_line_same_line() {
-    let source = r#"bar = { version = "0.1.0", optional = true }"#;
-    let input = Level::Error.title("unused optional dependency").snippet(
-        Snippet::source(source)
-            .origin("Cargo.toml")
-            .line_start(4)
-            .annotation(
-                Level::Error
-                    .span(0..3)
-                    .label("I need this to be really long so I can test overlaps"),
-            )
-            .annotation(
-                Level::Info
-                    .span(27..42)
-                    .label("This should also be long but not too long"),
-            ),
-    );
-    let expected = str![[r#"
-error: unused optional dependency
- --> Cargo.toml:4:1
-  |
-4 | bar = { version = "0.1.0", optional = true }
-  | ^^^                        --------------- info: This should also be long but not too long
-  | |
-  | I need this to be really long so I can test overlaps
-  |
-"#]];
-    let renderer = Renderer::plain().anonymized_line_numbers(false);
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-
-#[test]
-fn multi_and_single() {
-    let source = r#"bar = { version = "0.1.0", optional = true }
-this is another line
-so is this
-bar = { version = "0.1.0", optional = true }
-"#;
-    let input = Level::Error.title("unused optional dependency").snippet(
-        Snippet::source(source)
-            .line_start(4)
-            .annotation(
-                Level::Error
-                    .span(41..119)
-                    .label("I need this to be really long so I can test overlaps"),
-            )
-            .annotation(
-                Level::Info
-                    .span(27..42)
-                    .label("This should also be long but not too long"),
-            ),
-    );
-    let expected = str![[r#"
-error: unused optional dependency
-  |
-4 |   bar = { version = "0.1.0", optional = true }
-  |  ____________________________--------------^
-  | |                            |
-  | |                            info: This should also be long but not too long
-5 | | this is another line
-6 | | so is this
-7 | | bar = { version = "0.1.0", optional = true }
-  | |__________________________________________^ I need this to be really long so I can test overlaps
-  |
-"#]];
-    let renderer = Renderer::plain();
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-
-#[test]
-fn two_multi_and_single() {
-    let source = r#"bar = { version = "0.1.0", optional = true }
-this is another line
-so is this
-bar = { version = "0.1.0", optional = true }
-"#;
-    let input = Level::Error.title("unused optional dependency").snippet(
-        Snippet::source(source)
-            .line_start(4)
-            .annotation(
-                Level::Error
-                    .span(41..119)
-                    .label("I need this to be really long so I can test overlaps"),
-            )
-            .annotation(
-                Level::Error
-                    .span(8..102)
-                    .label("I need this to be really long so I can test overlaps"),
-            )
-            .annotation(
-                Level::Info
-                    .span(27..42)
-                    .label("This should also be long but not too long"),
-            ),
-    );
-    let expected = str![[r#"
-error: unused optional dependency
-  |
-4 |    bar = { version = "0.1.0", optional = true }
-  |   _________^__________________--------------^
-  |  |         |                  |
-  |  |_________|                  info: This should also be long but not too long
-  | ||
-5 | || this is another line
-6 | || so is this
-7 | || bar = { version = "0.1.0", optional = true }
-  | ||_________________________^________________^ I need this to be really long so I can test overlaps
-  | |__________________________|
-  |                            I need this to be really long so I can test overlaps
-  |
-"#]];
-    let renderer = Renderer::plain();
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-
-#[test]
-fn three_multi_and_single() {
-    let source = r#"bar = { version = "0.1.0", optional = true }
-this is another line
-so is this
-bar = { version = "0.1.0", optional = true }
-this is another line
-"#;
-    let input = Level::Error.title("unused optional dependency").snippet(
-        Snippet::source(source)
-            .line_start(4)
-            .annotation(
-                Level::Error
-                    .span(41..119)
-                    .label("I need this to be really long so I can test overlaps"),
-            )
-            .annotation(
-                Level::Error
-                    .span(8..102)
-                    .label("I need this to be really long so I can test overlaps"),
-            )
-            .annotation(
-                Level::Error
-                    .span(48..126)
-                    .label("I need this to be really long so I can test overlaps"),
-            )
-            .annotation(
-                Level::Info
-                    .span(27..42)
-                    .label("This should also be long but not too long"),
-            ),
-    );
-    let expected = str![[r#"
-error: unused optional dependency
-  |
-4 |     bar = { version = "0.1.0", optional = true }
-  |   __________^__________________--------------^
-  |  |          |                  |
-  |  |__________|                  info: This should also be long but not too long
-  | ||
-5 | ||  this is another line
-  | || ____^
-6 | ||| so is this
-7 | ||| bar = { version = "0.1.0", optional = true }
-  | |||_________________________^________________^ I need this to be really long so I can test overlaps
-  | |_|_________________________|
-  |   |                         I need this to be really long so I can test overlaps
-8 |   | this is another line
-  |   |____^ I need this to be really long so I can test overlaps
-  |
-"#]];
-    let renderer = Renderer::plain();
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
diff --git a/tests/rustc_tests.rs b/tests/rustc_tests.rs
deleted file mode 100644
index 54b7321..0000000
--- a/tests/rustc_tests.rs
+++ /dev/null
@@ -1,783 +0,0 @@
-//! These tests have been adapted from [Rust's parser tests][parser-tests].
-//!
-//! [parser-tests]: https://github.com/rust-lang/rust/blob/894f7a4ba6554d3797404bbf550d9919df060b97/compiler/rustc_parse/src/parser/tests.rs
-
-use annotate_snippets::{Level, Renderer, Snippet};
-
-use snapbox::{assert_data_eq, str};
-
-#[test]
-fn ends_on_col0() {
-    let source = r#"
-fn foo() {
-}
-"#;
-    let input = Level::Error.title("foo").snippet(
-        Snippet::source(source)
-            .line_start(1)
-            .origin("test.rs")
-            .fold(true)
-            .annotation(Level::Error.span(10..13).label("test")),
-    );
-
-    let expected = str![[r#"
-error: foo
- --> test.rs:2:10
-  |
-2 |   fn foo() {
-  |  __________^
-3 | | }
-  | |_^ test
-  |
-"#]];
-    let renderer = Renderer::plain();
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-#[test]
-fn ends_on_col2() {
-    let source = r#"
-fn foo() {
-
-
-  }
-"#;
-    let input = Level::Error.title("foo").snippet(
-        Snippet::source(source)
-            .line_start(1)
-            .origin("test.rs")
-            .fold(true)
-            .annotation(Level::Error.span(10..17).label("test")),
-    );
-
-    let expected = str![[r#"
-error: foo
- --> test.rs:2:10
-  |
-2 |   fn foo() {
-  |  __________^
-3 | |
-4 | |
-5 | |   }
-  | |___^ test
-  |
-"#]];
-    let renderer = Renderer::plain();
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-#[test]
-fn non_nested() {
-    let source = r#"
-fn foo() {
-  X0 Y0
-  X1 Y1
-  X2 Y2
-}
-"#;
-    let input = Level::Error.title("foo").snippet(
-        Snippet::source(source)
-            .line_start(1)
-            .origin("test.rs")
-            .fold(true)
-            .annotation(Level::Error.span(14..32).label("`X` is a good letter"))
-            .annotation(
-                Level::Warning
-                    .span(17..35)
-                    .label("`Y` is a good letter too"),
-            ),
-    );
-
-    let expected = str![[r#"
-error: foo
- --> test.rs:3:3
-  |
-3 |      X0 Y0
-  |  ____^  -
-  | | ______|
-4 | ||   X1 Y1
-5 | ||   X2 Y2
-  | ||____^__- `Y` is a good letter too
-  | |_____|
-  |       `X` is a good letter
-  |
-"#]];
-    let renderer = Renderer::plain();
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-#[test]
-fn nested() {
-    let source = r#"
-fn foo() {
-  X0 Y0
-  Y1 X1
-}
-"#;
-    let input = Level::Error.title("foo").snippet(
-        Snippet::source(source)
-            .line_start(1)
-            .origin("test.rs")
-            .fold(true)
-            .annotation(Level::Error.span(14..27).label("`X` is a good letter"))
-            .annotation(
-                Level::Warning
-                    .span(17..24)
-                    .label("`Y` is a good letter too"),
-            ),
-    );
-
-    let expected = str![[r#"
-error: foo
- --> test.rs:3:3
-  |
-3 |      X0 Y0
-  |  ____^  -
-  | | ______|
-4 | ||   Y1 X1
-  | ||____-__^ `X` is a good letter
-  |  |____|
-  |       `Y` is a good letter too
-  |
-"#]];
-    let renderer = Renderer::plain();
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-#[test]
-fn different_overlap() {
-    let source = r#"
-fn foo() {
-  X0 Y0 Z0
-  X1 Y1 Z1
-  X2 Y2 Z2
-  X3 Y3 Z3
-}
-"#;
-    let input = Level::Error.title("foo").snippet(
-        Snippet::source(source)
-            .line_start(1)
-            .origin("test.rs")
-            .fold(true)
-            .annotation(Level::Error.span(17..38).label("`X` is a good letter"))
-            .annotation(
-                Level::Warning
-                    .span(31..49)
-                    .label("`Y` is a good letter too"),
-            ),
-    );
-
-    let expected = str![[r#"
-error: foo
- --> test.rs:3:6
-  |
-3 |      X0 Y0 Z0
-  |  _______^
-4 | |    X1 Y1 Z1
-  | | _________-
-5 | ||   X2 Y2 Z2
-  | ||____^ `X` is a good letter
-6 |  |   X3 Y3 Z3
-  |  |____- `Y` is a good letter too
-  |
-"#]];
-    let renderer = Renderer::plain();
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-#[test]
-fn triple_overlap() {
-    let source = r#"
-fn foo() {
-  X0 Y0 Z0
-  X1 Y1 Z1
-  X2 Y2 Z2
-}
-"#;
-    let input = Level::Error.title("foo").snippet(
-        Snippet::source(source)
-            .line_start(1)
-            .origin("test.rs")
-            .fold(true)
-            .annotation(Level::Error.span(14..38).label("`X` is a good letter"))
-            .annotation(
-                Level::Warning
-                    .span(17..41)
-                    .label("`Y` is a good letter too"),
-            )
-            .annotation(Level::Warning.span(20..44).label("`Z` label")),
-    );
-
-    let expected = str![[r#"
-error: foo
- --> test.rs:3:3
-  |
-3 |       X0 Y0 Z0
-  |  _____^  -  -
-  | | _______|  |
-  | || _________|
-4 | |||   X1 Y1 Z1
-5 | |||   X2 Y2 Z2
-  | |||____^__-__- `Z` label
-  | ||_____|__|
-  | |______|  `Y` is a good letter too
-  |        `X` is a good letter
-  |
-"#]];
-    let renderer = Renderer::plain();
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-#[test]
-fn triple_exact_overlap() {
-    let source = r#"
-fn foo() {
-  X0 Y0 Z0
-  X1 Y1 Z1
-  X2 Y2 Z2
-}
-"#;
-    let input = Level::Error.title("foo").snippet(
-        Snippet::source(source)
-            .line_start(1)
-            .origin("test.rs")
-            .fold(true)
-            .annotation(Level::Error.span(14..38).label("`X` is a good letter"))
-            .annotation(
-                Level::Warning
-                    .span(14..38)
-                    .label("`Y` is a good letter too"),
-            )
-            .annotation(Level::Warning.span(14..38).label("`Z` label")),
-    );
-
-    // This should have a `^` but we currently don't support the idea of a
-    // "primary" annotation, which would solve this
-    let expected = str![[r#"
-error: foo
- --> test.rs:3:3
-  |
-3 | /   X0 Y0 Z0
-4 | |   X1 Y1 Z1
-5 | |   X2 Y2 Z2
-  | |    -
-  | |____|
-  |      `X` is a good letter
-  |      `Y` is a good letter too
-  |      `Z` label
-  |
-"#]];
-    let renderer = Renderer::plain();
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-#[test]
-fn minimum_depth() {
-    let source = r#"
-fn foo() {
-  X0 Y0 Z0
-  X1 Y1 Z1
-  X2 Y2 Z2
-  X3 Y3 Z3
-}
-"#;
-    let input = Level::Error.title("foo").snippet(
-        Snippet::source(source)
-            .line_start(1)
-            .origin("test.rs")
-            .fold(true)
-            .annotation(Level::Error.span(17..27).label("`X` is a good letter"))
-            .annotation(
-                Level::Warning
-                    .span(28..44)
-                    .label("`Y` is a good letter too"),
-            )
-            .annotation(Level::Warning.span(36..52).label("`Z`")),
-    );
-
-    let expected = str![[r#"
-error: foo
- --> test.rs:3:6
-  |
-3 |      X0 Y0 Z0
-  |  _______^
-4 | |    X1 Y1 Z1
-  | | ____^_-
-  | ||____|
-  |  |    `X` is a good letter
-5 |  |   X2 Y2 Z2
-  |  |___-______- `Y` is a good letter too
-  |   ___|
-  |  |
-6 |  |   X3 Y3 Z3
-  |  |_______- `Z`
-  |
-"#]];
-    let renderer = Renderer::plain();
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-#[test]
-fn non_overlapping() {
-    let source = r#"
-fn foo() {
-  X0 Y0 Z0
-  X1 Y1 Z1
-  X2 Y2 Z2
-  X3 Y3 Z3
-}
-"#;
-    let input = Level::Error.title("foo").snippet(
-        Snippet::source(source)
-            .line_start(1)
-            .origin("test.rs")
-            .fold(true)
-            .annotation(Level::Error.span(14..27).label("`X` is a good letter"))
-            .annotation(
-                Level::Warning
-                    .span(39..55)
-                    .label("`Y` is a good letter too"),
-            ),
-    );
-
-    let expected = str![[r#"
-error: foo
- --> test.rs:3:3
-  |
-3 | /   X0 Y0 Z0
-4 | |   X1 Y1 Z1
-  | |____^ `X` is a good letter
-5 |     X2 Y2 Z2
-  |  ______-
-6 | |   X3 Y3 Z3
-  | |__________- `Y` is a good letter too
-  |
-"#]];
-    let renderer = Renderer::plain();
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-#[test]
-fn overlapping_start_and_end() {
-    let source = r#"
-fn foo() {
-  X0 Y0 Z0
-  X1 Y1 Z1
-  X2 Y2 Z2
-  X3 Y3 Z3
-}
-"#;
-    let input = Level::Error.title("foo").snippet(
-        Snippet::source(source)
-            .line_start(1)
-            .origin("test.rs")
-            .fold(true)
-            .annotation(Level::Error.span(17..27).label("`X` is a good letter"))
-            .annotation(
-                Level::Warning
-                    .span(31..55)
-                    .label("`Y` is a good letter too"),
-            ),
-    );
-
-    let expected = str![[r#"
-error: foo
- --> test.rs:3:6
-  |
-3 |      X0 Y0 Z0
-  |  _______^
-4 | |    X1 Y1 Z1
-  | | ____^____-
-  | ||____|
-  |  |    `X` is a good letter
-5 |  |   X2 Y2 Z2
-6 |  |   X3 Y3 Z3
-  |  |__________- `Y` is a good letter too
-  |
-"#]];
-    let renderer = Renderer::plain();
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-#[test]
-fn multiple_labels_primary_without_message() {
-    let source = r#"
-fn foo() {
-  a { b { c } d }
-}
-"#;
-    let input = Level::Error.title("foo").snippet(
-        Snippet::source(source)
-            .line_start(1)
-            .origin("test.rs")
-            .fold(true)
-            .annotation(Level::Error.span(18..25).label(""))
-            .annotation(Level::Warning.span(14..27).label("`a` is a good letter"))
-            .annotation(Level::Warning.span(22..23).label("")),
-    );
-
-    let expected = str![[r#"
-error: foo
- --> test.rs:3:7
-  |
-3 |   a { b { c } d }
-  |   ----^^^^-^^-- `a` is a good letter
-  |
-"#]];
-    let renderer = Renderer::plain();
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-#[test]
-fn multiple_labels_secondary_without_message() {
-    let source = r#"
-fn foo() {
-  a { b { c } d }
-}
-"#;
-    let input = Level::Error.title("foo").snippet(
-        Snippet::source(source)
-            .line_start(1)
-            .origin("test.rs")
-            .fold(true)
-            .annotation(Level::Error.span(14..27).label("`a` is a good letter"))
-            .annotation(Level::Warning.span(18..25).label("")),
-    );
-
-    let expected = str![[r#"
-error: foo
- --> test.rs:3:3
-  |
-3 |   a { b { c } d }
-  |   ^^^^-------^^ `a` is a good letter
-  |
-"#]];
-    let renderer = Renderer::plain();
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-#[test]
-fn multiple_labels_primary_without_message_2() {
-    let source = r#"
-fn foo() {
-  a { b { c } d }
-}
-"#;
-    let input = Level::Error.title("foo").snippet(
-        Snippet::source(source)
-            .line_start(1)
-            .origin("test.rs")
-            .fold(true)
-            .annotation(Level::Error.span(18..25).label("`b` is a good letter"))
-            .annotation(Level::Warning.span(14..27).label(""))
-            .annotation(Level::Warning.span(22..23).label("")),
-    );
-
-    let expected = str![[r#"
-error: foo
- --> test.rs:3:7
-  |
-3 |   a { b { c } d }
-  |   ----^^^^-^^--
-  |       |
-  |       `b` is a good letter
-  |
-"#]];
-    let renderer = Renderer::plain();
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-#[test]
-fn multiple_labels_secondary_without_message_2() {
-    let source = r#"
-fn foo() {
-  a { b { c } d }
-}
-"#;
-    let input = Level::Error.title("foo").snippet(
-        Snippet::source(source)
-            .line_start(1)
-            .origin("test.rs")
-            .fold(true)
-            .annotation(Level::Error.span(14..27).label(""))
-            .annotation(Level::Warning.span(18..25).label("`b` is a good letter")),
-    );
-
-    let expected = str![[r#"
-error: foo
- --> test.rs:3:3
-  |
-3 |   a { b { c } d }
-  |   ^^^^-------^^
-  |       |
-  |       `b` is a good letter
-  |
-"#]];
-    let renderer = Renderer::plain();
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-#[test]
-fn multiple_labels_secondary_without_message_3() {
-    let source = r#"
-fn foo() {
-  a  bc  d
-}
-"#;
-    let input = Level::Error.title("foo").snippet(
-        Snippet::source(source)
-            .line_start(1)
-            .origin("test.rs")
-            .fold(true)
-            .annotation(Level::Error.span(14..18).label("`a` is a good letter"))
-            .annotation(Level::Warning.span(18..22).label("")),
-    );
-
-    let expected = str![[r#"
-error: foo
- --> test.rs:3:3
-  |
-3 |   a  bc  d
-  |   ^^^^----
-  |   |
-  |   `a` is a good letter
-  |
-"#]];
-    let renderer = Renderer::plain();
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-#[test]
-fn multiple_labels_without_message() {
-    let source = r#"
-fn foo() {
-  a { b { c } d }
-}
-"#;
-    let input = Level::Error.title("foo").snippet(
-        Snippet::source(source)
-            .line_start(1)
-            .origin("test.rs")
-            .fold(true)
-            .annotation(Level::Error.span(14..27).label(""))
-            .annotation(Level::Warning.span(18..25).label("")),
-    );
-
-    let expected = str![[r#"
-error: foo
- --> test.rs:3:3
-  |
-3 |   a { b { c } d }
-  |   ^^^^-------^^
-  |
-"#]];
-    let renderer = Renderer::plain();
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-#[test]
-fn multiple_labels_without_message_2() {
-    let source = r#"
-fn foo() {
-  a { b { c } d }
-}
-"#;
-    let input = Level::Error.title("foo").snippet(
-        Snippet::source(source)
-            .line_start(1)
-            .origin("test.rs")
-            .fold(true)
-            .annotation(Level::Error.span(18..25).label(""))
-            .annotation(Level::Warning.span(14..27).label(""))
-            .annotation(Level::Warning.span(22..23).label("")),
-    );
-
-    let expected = str![[r#"
-error: foo
- --> test.rs:3:7
-  |
-3 |   a { b { c } d }
-  |   ----^^^^-^^--
-  |
-"#]];
-    let renderer = Renderer::plain();
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-#[test]
-fn multiple_labels_with_message() {
-    let source = r#"
-fn foo() {
-  a { b { c } d }
-}
-"#;
-    let input = Level::Error.title("foo").snippet(
-        Snippet::source(source)
-            .line_start(1)
-            .origin("test.rs")
-            .fold(true)
-            .annotation(Level::Error.span(14..27).label("`a` is a good letter"))
-            .annotation(Level::Warning.span(18..25).label("`b` is a good letter")),
-    );
-
-    let expected = str![[r#"
-error: foo
- --> test.rs:3:3
-  |
-3 |   a { b { c } d }
-  |   ^^^^-------^^
-  |   |   |
-  |   |   `b` is a good letter
-  |   `a` is a good letter
-  |
-"#]];
-    let renderer = Renderer::plain();
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-#[test]
-fn ingle_label_with_message() {
-    let source = r#"
-fn foo() {
-  a { b { c } d }
-}
-"#;
-    let input = Level::Error.title("foo").snippet(
-        Snippet::source(source)
-            .line_start(1)
-            .origin("test.rs")
-            .fold(true)
-            .annotation(Level::Error.span(14..27).label("`a` is a good letter")),
-    );
-
-    let expected = str![[r#"
-error: foo
- --> test.rs:3:3
-  |
-3 |   a { b { c } d }
-  |   ^^^^^^^^^^^^^ `a` is a good letter
-  |
-"#]];
-    let renderer = Renderer::plain();
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-#[test]
-fn single_label_without_message() {
-    let source = r#"
-fn foo() {
-  a { b { c } d }
-}
-"#;
-    let input = Level::Error.title("foo").snippet(
-        Snippet::source(source)
-            .line_start(1)
-            .origin("test.rs")
-            .fold(true)
-            .annotation(Level::Error.span(14..27).label("")),
-    );
-
-    let expected = str![[r#"
-error: foo
- --> test.rs:3:3
-  |
-3 |   a { b { c } d }
-  |   ^^^^^^^^^^^^^
-  |
-"#]];
-    let renderer = Renderer::plain();
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-#[test]
-fn long_snippet() {
-    let source = r#"
-fn foo() {
-  X0 Y0 Z0
-  X1 Y1 Z1
-1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-  X2 Y2 Z2
-  X3 Y3 Z3
-}
-"#;
-    let input = Level::Error.title("foo").snippet(
-        Snippet::source(source)
-            .line_start(1)
-            .origin("test.rs")
-            .fold(true)
-            .annotation(Level::Error.span(17..27).label("`X` is a good letter"))
-            .annotation(
-                Level::Warning
-                    .span(31..76)
-                    .label("`Y` is a good letter too"),
-            ),
-    );
-
-    let expected = str![[r#"
-error: foo
-  --> test.rs:3:6
-   |
- 3 |      X0 Y0 Z0
-   |  _______^
- 4 | |    X1 Y1 Z1
-   | | ____^____-
-   | ||____|
-   |  |    `X` is a good letter
- 5 |  | 1
-...   |
-15 |  |   X2 Y2 Z2
-16 |  |   X3 Y3 Z3
-   |  |__________- `Y` is a good letter too
-   |
-"#]];
-    let renderer = Renderer::plain();
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}
-#[test]
-fn long_snippet_multiple_spans() {
-    let source = r#"
-fn foo() {
-  X0 Y0 Z0
-1
-2
-3
-  X1 Y1 Z1
-4
-5
-6
-  X2 Y2 Z2
-7
-8
-9
-10
-  X3 Y3 Z3
-}
-"#;
-    let input = Level::Error.title("foo").snippet(
-        Snippet::source(source)
-            .line_start(1)
-            .origin("test.rs")
-            .fold(true)
-            .annotation(Level::Error.span(17..73).label("`Y` is a good letter"))
-            .annotation(
-                Level::Warning
-                    .span(37..56)
-                    .label("`Z` is a good letter too"),
-            ),
-    );
-
-    let expected = str![[r#"
-error: foo
-  --> test.rs:3:6
-   |
- 3 |      X0 Y0 Z0
-   |  _______^
- 4 | |  1
- 5 | |  2
- 6 | |  3
- 7 | |    X1 Y1 Z1
-   | | _________-
- 8 | || 4
- 9 | || 5
-10 | || 6
-11 | ||   X2 Y2 Z2
-   | ||__________- `Z` is a good letter too
-12 | |  7
-...  |
-15 | |  10
-16 | |    X3 Y3 Z3
-   | |________^ `Y` is a good letter
-   |
-"#]];
-    let renderer = Renderer::plain();
-    assert_data_eq!(renderer.render(input).to_string(), expected);
-}