|
73 | 73 |
|
74 | 74 | M.clear = clear |
75 | 75 |
|
| 76 | +--- Resolve sign_text character based on style and position in cell |
| 77 | +local function sign_char(style, i, start_line, end_line) |
| 78 | + if style ~= "normal" and style ~= "full" then return "▎" end |
| 79 | + local is_single = (start_line == end_line) |
| 80 | + if is_single then return "◆" end |
| 81 | + if i == start_line then return "╭" end |
| 82 | + if i == end_line then return "╰" end |
| 83 | + return "│" |
| 84 | +end |
| 85 | + |
76 | 86 | --- Build virt_text for a line based on style and position |
77 | 87 | local function build_virt_text(style, i, start_line, end_line, cell_lines) |
78 | 88 | if style == "minimal" then return nil end |
79 | 89 |
|
80 | | - local is_single = (start_line == end_line) |
81 | 90 | local is_top = (i == start_line) |
82 | 91 | local is_bottom = (i == end_line) |
83 | 92 |
|
84 | | - if style == "normal" then |
85 | | - if is_single then |
86 | | - return { { " ◆ " .. cell_lines, "SageFsCellBound" } } |
87 | | - elseif is_top then |
88 | | - return { { " ╭", "SageFsCellBound" } } |
89 | | - elseif is_bottom then |
90 | | - return { { " ╰ " .. cell_lines, "SageFsCellBound" } } |
91 | | - end |
92 | | - elseif style == "full" then |
| 93 | + -- Full mode: show line count at top, "cell end" at bottom |
| 94 | + if style == "full" then |
93 | 95 | local line_word = cell_lines == 1 and "line" or "lines" |
94 | 96 | if is_top then |
95 | | - return { { " ╭ " .. cell_lines .. " " .. line_word, "SageFsCellBound" } } |
| 97 | + return { { " " .. cell_lines .. " " .. line_word, "SageFsCellBound" } } |
96 | 98 | elseif is_bottom then |
97 | | - return { { " ╰ cell end", "SageFsCellBound" } } |
| 99 | + return { { " cell end", "SageFsCellBound" } } |
98 | 100 | end |
99 | 101 | end |
100 | 102 | return nil |
@@ -141,7 +143,7 @@ local function render(buf, start_line, end_line) |
141 | 143 |
|
142 | 144 | for i = start_line, math.min(end_line, line_count) do |
143 | 145 | local opts = { |
144 | | - sign_text = "▎", |
| 146 | + sign_text = sign_char(style, i, start_line, end_line), |
145 | 147 | sign_hl_group = hl.bar, |
146 | 148 | number_hl_group = "SageFsCellNumber", |
147 | 149 | priority = 5, |
|
0 commit comments