feat(chunk): straight line option#183
Conversation
sunwoo101
commented
May 6, 2026
- Added an option to use a straight line for the current scope
There was a problem hiding this comment.
Pull request overview
Adds a new chunk.straight configuration option to change how the current-scope “chunk” indicator is rendered, aiming to provide a straight-line style.
Changes:
- Introduces
straightboolean option inChunkConf(defaultfalse). - Updates chunk rendering logic to alter
start_colcomputation and to skip top/bottom chunk cap rendering whenstraightis enabled.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| lua/hlchunk/mods/chunk/init.lua | Adjusts chunk rendering logic for the new straight mode (start column + cap rendering behavior). |
| lua/hlchunk/mods/chunk/chunk_conf.lua | Adds straight to the chunk configuration schema and defaults. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| end | ||
|
|
||
| if beg_blank_len > 0 then | ||
| if not self.conf.straight and beg_blank_len > 0 then |
There was a problem hiding this comment.
This is intentional. straight = true is meant to highlight the current scope's indent level rather than highlighting the line at the previous indent.
| @@ -108,7 +113,7 @@ function ChunkMod:get_chunk_data(range, virt_text_list, row_list, virt_text_win_ | |||
| end | |||
| vim.list_extend(virt_text_list, chars) | |||
|
|
|||
There was a problem hiding this comment.
This is also intentional. With straight = true we wouldn't want the vertical line connecting the start and end of the scope to overlap with the line starting the scope and the end line.
|
@shellRaining No issues in the code. I added comments in Copilot's review's conversations explaining why what I did is intentional. |
|
great, thanks for your contribution! By the way, could you please help update the docs? 😄 |
