Commit 33456cb
committed
fix: stabilize inline virt_text ordering at shared positions in table renderer
Neovim's mark tree traversal order is not stable for inline virt_text when
range marks (conceal+border) and point marks (padding/decoration) coexist
at the same (row, col). The traversal order depends on the internal tree
structure, which varies with the total number of marks in the buffer.
In hybrid mode, filtering out preceding content changes how many marks are
created, shifting the mark tree structure and causing padding/decoration
marks to swap visual order with junction/border marks at shared positions.
This made table borders appear misplaced when the cursor was on a heading
or inside a nearby table.
Fix: set right_gravity=false on all inline padding/decoration marks at
col_end positions (header row and separator row). Neovim sorts
right_gravity=false before right_gravity=true at the same position,
guaranteeing stable traversal order regardless of tree structure.1 parent 52f7156 commit 33456cb
1 file changed
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1857 | 1857 | | |
1858 | 1858 | | |
1859 | 1859 | | |
| 1860 | + | |
1860 | 1861 | | |
1861 | 1862 | | |
1862 | 1863 | | |
| |||
1867 | 1868 | | |
1868 | 1869 | | |
1869 | 1870 | | |
| 1871 | + | |
1870 | 1872 | | |
1871 | 1873 | | |
1872 | 1874 | | |
| |||
1877 | 1879 | | |
1878 | 1880 | | |
1879 | 1881 | | |
| 1882 | + | |
1880 | 1883 | | |
1881 | 1884 | | |
1882 | 1885 | | |
| |||
1886 | 1889 | | |
1887 | 1890 | | |
1888 | 1891 | | |
| 1892 | + | |
1889 | 1893 | | |
1890 | 1894 | | |
1891 | 1895 | | |
| |||
1967 | 1971 | | |
1968 | 1972 | | |
1969 | 1973 | | |
| 1974 | + | |
1970 | 1975 | | |
1971 | 1976 | | |
1972 | 1977 | | |
| |||
2014 | 2019 | | |
2015 | 2020 | | |
2016 | 2021 | | |
| 2022 | + | |
2017 | 2023 | | |
2018 | 2024 | | |
2019 | 2025 | | |
| |||
2062 | 2068 | | |
2063 | 2069 | | |
2064 | 2070 | | |
| 2071 | + | |
2065 | 2072 | | |
2066 | 2073 | | |
2067 | 2074 | | |
| |||
2111 | 2118 | | |
2112 | 2119 | | |
2113 | 2120 | | |
| 2121 | + | |
2114 | 2122 | | |
2115 | 2123 | | |
2116 | 2124 | | |
| |||
0 commit comments