Improve handling of compiler directives and attributes#47
Open
idbrii wants to merge 4 commits intoOrangeT:masterfrom
Open
Improve handling of compiler directives and attributes#47idbrii wants to merge 4 commits intoOrangeT:masterfrom
idbrii wants to merge 4 commits intoOrangeT:masterfrom
Conversation
Get improvement from omnisharp-vim. Retrieved from: https://github.com/OmniSharp/omnisharp-vim/blob/4a6ffe6fdbb09b594fc503d022c1e263dd3edd8e/indent/cs.vim
Compiler directives should go to the first column if that's what the
user configured.
Fixes directive when it follows an attribute line:
[SerializeField]
#if UNITY_EDITOR
public
#endif
string m_PrettyName = "";
However, content inside directive (public) is still indented
incorrectly.
Prefer function names over comments.
Easier to remove the s: off of these and interactively do:
echo IsAttributeLine(getcurpos()[1])
Now content inside directive (public) is indented correctly (matches
attribute):
[SerializeField]
#if UNITY_EDITOR
public
#endif
string m_PrettyName = "";
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.
Support zero-column compiler directives.
Handle attributes followed by compiler directives.
I've also made a PR for these changes to nickspoons/vim-cs. I'll push future fixes there, since the maintainer is more active.