Skip to content

✨feat(dash.width): New option added. #92

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

✨feat(dash.width): New option added. #92

wants to merge 1 commit into from

Conversation

Zeioth
Copy link
Contributor

@Zeioth Zeioth commented Jul 24, 2024

Users can now do

dash = {
  icon = '',
  width = 79
},

screenshot_2024-07-24_18-45-13_296783475

To limit the width of dash. This is cool for users using vim.opt.colorcolumn to improve readability.

MeanderingProgrammer added a commit that referenced this pull request Jul 25, 2024
## Details

Add dash.width option which is either the string 'full' or an integer.

When it is 'full' the dashed line will extend across the entire line,
which is the current behavior and the default value.

When it is a number the width of the dashed line will be the hard coded
value provided.

Original PR: #92

Co-Authored-By: Zeioth <[email protected]>
@MeanderingProgrammer
Copy link
Owner

Thanks for the PR!

I merged in this change here: ff1b449

There were a few things I wanted to change from this implementation.

  1. Setting the default width to the width of the current buffer at the time the plugin loads. This fixes the width to a value and will not handle, for instance, resizing the terminal within a session. So the width value needs to be computed at the time the line is rendered.
  2. To fix 1 I ended up making the width type either the string full or an integer. I wasn't sure if I could do good enough type validation on this for the health check, but turned out not to be that bad.
  3. The BasicComponent type is shared between the dash and the quote components. This was just because they happened to be the same at the time, but now that dash has a width and that does not make sense for a quote I split this into 2 separate types.

In the process of figuring out 2 I wrote most of the code, so I ended up just merging that as a different commit.

I appreciate the idea and the implementation though!

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.

2 participants