diff --git a/docs/changelog.rst b/docs/changelog.rst index 7d5539b7e..006356140 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -39,6 +39,10 @@ To update |kitty|, :doc:`follow the instructions `. - A new theme for the kitty website with support for dark mode. +- Render the ┄ ┅ ┆ ┇ ┈ ┉ ┊ ┋ with spaces at the edges. Matches rendering in + most other programs and allows long chains of them to look better + (:iss:`3844`) + 0.21.2 [2021-06-28] ---------------------- diff --git a/kitty/fonts/box_drawing.py b/kitty/fonts/box_drawing.py index 08408057c..fcf6c1ac4 100644 --- a/kitty/fonts/box_drawing.py +++ b/kitty/fonts/box_drawing.py @@ -60,17 +60,17 @@ def half_vline(buf: BufType, width: int, height: int, level: int = 1, which: str def get_holes(sz: int, hole_sz: int, num: int) -> List[Tuple[int, ...]]: - if num == 1: - pts = [sz // 2] - elif num == 2: - ssz = (sz - 2 * hole_sz) // 3 - pts = [ssz + hole_sz // 2, 2 * ssz + hole_sz // 2 + hole_sz] - elif num == 3: - ssz = (sz - 3 * hole_sz) // 4 - pts = [ssz + hole_sz // 2, 2 * ssz + hole_sz // 2 + hole_sz, 3 * ssz + 2 * hole_sz + hole_sz // 2] + all_holes_use = (num + 1) * hole_sz + individual_block_size = (sz - all_holes_use) // (num + 1) + half_hole_sz = hole_sz // 2 + pos = - half_hole_sz holes = [] - for c in pts: - holes.append(tuple(range(c - hole_sz // 2, c - hole_sz // 2 + hole_sz))) + while pos < sz: + left = max(0, pos) + right = min(sz, pos + hole_sz) + if right > left: + holes.append(tuple(range(left, right))) + pos = right + individual_block_size return holes