fix(indentation): hover behavior when indentation not set#863
Merged
gorkem merged 1 commit intoredhat-developer:mainfrom May 3, 2023
Merged
fix(indentation): hover behavior when indentation not set#863gorkem merged 1 commit intoredhat-developer:mainfrom
gorkem merged 1 commit intoredhat-developer:mainfrom
Conversation
0e73345 to
c7b8877
Compare
polyzen
previously approved these changes
Apr 24, 2023
Contributor
|
Works for me. Backporting to the Arch Linux package ❤️ |
|
Oh yes please. I am having this problem :) |
This was referenced May 1, 2023
Collaborator
|
can you rebase the PR? |
c7b8877 to
cca7c2f
Compare
Contributor
Author
Collaborator
|
CI failed with a prettier error. I did not notice that #831 fixed this on the side but did not provide any tests. This is a good complement PR, and I would like to merge it if you can update it for the prettier fix |
The previous behavior of hover replaces indentations with the  
entity, because Markdown treats whitespace at the beginning of a line
in a special way. However, when the indentation setting wasn't set, the
regex that does that replace was set to empty ("") and so would include
an   entity between every character.
Signed-off-by: Kasama <robertoaall@gmail.com>
cca7c2f to
ab85743
Compare
Contributor
Author
|
fixed. It seems my auto-format wasn't setup to use the project's config 😄 |
Contributor
Author
|
Nice, would be great to have a release soon, so we can have this fix rolled out! Thanks for the help! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
The previous behavior for hover replaces indentations with the
 entity, because Markdown treats whitespace at the beginning of a line in a special way. However, when the indentation setting wasn't set, the regex that does that replace was set to empty ("") and so would include an entity between every character.This went under the radar because the previous PR #844 also changed the tests setup to include a
.withIndentationcall, which made sure all tests were passing.In this PR I'm reverting that to the default behavior for most tests, but overriding the default only on the test introduced in #844.
What issues does this PR fix or reference?
The issue is referenced on a comment of PR #844. here
Is it tested? How?
I have tested this fix with a neovim setup as described in the original problem report in the PR comment.
At the risk of simply repeating myself, below is the full set of reproduction steps:
Open for steps
cd $(mktemp)init.luawith the following contents:.gitlab-ci.yamlwith the following contentsrun neovim with
nvim --noplugin -u init.lua .gitlab-ci.yaml.give it a couple of seconds to spin up
yaml-language-serverand press<space>with the cursor on top of thestagesword.