-
Notifications
You must be signed in to change notification settings - Fork 52
bug: left_pad does not work with tabs #230
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
Comments
The issue is that the lines in the code block have tabs and the left padding (made up of spaces) is not applied as a result. Changing the tabs to spaces fixes this. For instance the following code block works correctly with your configuration:
I'll see if I can handle tabs. |
## Details Issue: #230 When adding inline spaces for padding or margin in code blocks tabs would cause the spacing to not work. For example if a user wants left padding of 2 but has tabstop set to 4 the 2 spaces added would be ignored since they did not occupy enough space to shift the text. To fix this when adding spaces to the left first check if the code block contains any tabs. If it does instead of applying the spacing directly find the next value that is a multiple of the users tabstop and use that. From the previous example we would add 4 spaces now instead of 2. A tabstop of 8 and a padding of 10 would result in 16 spaces.
Fixed here: d80acb3 There's no way to shift text to the left by 2 spaces when it's before a tab and your tab size is 4. So now the next multiple of your tab size will be used as the left padding. So your example will be left padded by 4 spaces and the right padding will be whatever value you set, in this case also 4. This is just how tabs work:
The extra space in the second example doesn't shift the |
Neovim version (nvim -v)
0.10.1
Neovim distribution
LazyVim
Operating system
MacOS
Terminal emulator / GUI
iTerm2
Describe the bug
When i set the "code" configuration as shown blow, with a left_pad and a right_pad defined it actually makes the right_pad be (left_pad + declared value of right_pad) 6 in this case.
this is from the wiki
My suspicion is that these are happening in these areas of the code:
area1
area2
Expected behavior
The right padding should only be the value of the right_pad value in the config and not the sum of the left_pad and right_pad (value from the config)
Healthcheck output
Plugin configuration
Plugin error log
Confirmations
Additional information
No response
The text was updated successfully, but these errors were encountered: