Skip to content
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

Implement padchar configuration #46

Closed
wants to merge 2 commits into from
Closed

Implement padchar configuration #46

wants to merge 2 commits into from

Conversation

reo101
Copy link

@reo101 reo101 commented Jan 14, 2022

The the rpad and lpad functions have a third parameter for an (optional) padchar but in it isn't passed anywhere (omitted here and here). That leads to " " (whitespace) always being the padchar which (combined with a listchar for trailing spaces) also leads to situations like this:
image

In this PR, I've added a padchar option to the config for aerial that eliminates this problem.

@stevearc
Copy link
Owner

The purpose of padding out the whitespace at the end of the line is so that the line highlight is full-width. If your listchars setting causes the display to look bad, wouldn't a better solution be to change listchars for the aerial window? I think it would be reasonable to set a default that hides trailing spaces.

Would you actually want the aerial window to have something other than whitespace padding out the line?

@reo101
Copy link
Author

reo101 commented Jan 14, 2022

I agree, one can change the window-local listchars (maybe with an autocommand), and also yes - I think a padding of dashes or underscores would look nice too.

stevearc added a commit that referenced this pull request Jan 15, 2022
@stevearc
Copy link
Owner

How about this as a solution then: I added a commit that disables most listchars by default in the aerial window. If you or anyone wants the padding characters to be different, you can modify those listchars with an autocmd, e.g.

autocmd FileType aerial setlocal listchars+=trail:-

Does that fix all of your issues?

@reo101
Copy link
Author

reo101 commented Jan 15, 2022

Yes, that would do it! Thanks a lot 😄

@reo101 reo101 closed this Jan 15, 2022
@reo101
Copy link
Author

reo101 commented Jan 15, 2022

Small update: :remove()-ing listchars from opt_local only clears previously set local listchars but not the original ones.

@stevearc
Copy link
Owner

Apologies! When I tested I was using a global listchars value that included options that weren't removed by aerial, so the remaining window-local value was sufficient to override the global defaults. Upon further testing, that doesn't work if, for example, all you have set is trail:-. I changed how the override is happening to be simpler and hopefully get rid of those edge cases.

@reo101
Copy link
Author

reo101 commented Jan 16, 2022

Thank you yet again! I can now confirm that it is working as expected. Have a great day and keep up the good work 🎉

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.

None yet

2 participants