Skip to content

feat(chunk): straight line option#183

Merged
shellRaining merged 1 commit into
shellRaining:mainfrom
sunwoo101:main
May 7, 2026
Merged

feat(chunk): straight line option#183
shellRaining merged 1 commit into
shellRaining:mainfrom
sunwoo101:main

Conversation

@sunwoo101
Copy link
Copy Markdown
Contributor

  • Added an option to use a straight line for the current scope
image

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 straight boolean option in ChunkConf (default false).
  • Updates chunk rendering logic to alter start_col computation and to skip top/bottom chunk cap rendering when straight is 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
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@sunwoo101
Copy link
Copy Markdown
Contributor Author

@shellRaining No issues in the code. I added comments in Copilot's review's conversations explaining why what I did is intentional.

The failed StyLua check is unrelated to this PR.
image

@shellRaining shellRaining merged commit 46b078a into shellRaining:main May 7, 2026
8 of 10 checks passed
@shellRaining
Copy link
Copy Markdown
Owner

shellRaining commented May 7, 2026

great, thanks for your contribution!

By the way, could you please help update the docs? 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants