Fix multi argument indent when using noexpandtab; make it optional#4
Open
idbrii wants to merge 2 commits intoraymond-w-ko:masterfrom
Open
Fix multi argument indent when using noexpandtab; make it optional#4idbrii wants to merge 2 commits intoraymond-w-ko:masterfrom
idbrii wants to merge 2 commits intoraymond-w-ko:masterfrom
Conversation
Cleaned up version of suokko's fix from: raymond-w-ko#2 (Renaming and making the new func more like GetStringIndent.) We must \t as &shiftwidth instead of a single char. Can't use GetStringIndent because it stops when it hits non whitespace and making it support both cases is awkward. With `noet sw=8 ts=8` old behaviour: f = function(a, b) print(a) g = function(a, b) end end New behaviour fixes indent for g: f = function(a, b) print(a) g = function(a, b) end end
let g:lua_indent_align_params = 1 for aligning function params:
f = function(a,
b)
print(a)
g = function(a,
b)
end
end
g = function(a,
b)
end
create(10,
20,
30,
get(
1,
2),
val())
let g:lua_indent_align_params = 0 for single indent for function params:
f = function(a,
b)
print(a)
g = function(a,
b)
end
end
g = function(a,
b)
end
create(10,
20,
30,
get(
1,
2),
val())
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.
Cleaned up version of suokko's fix from #2 to more closely match existing code style and naming.
We must \t as &shiftwidth instead of a single char. Can't use
GetStringIndent because it stops when it hits non whitespace and making
it support both cases is awkward.
With
noet sw=8 ts=8old behaviour:New behaviour fixes indent for g:
Also add g:lua_indent_align_params.
let g:lua_indent_align_params = 0for single indent for function params:Trying to evaluate indentation in this plugin vs tbastos/vim-lua, so I thought I'd contribute some changes I made along the way. In the end, tbastos's version seems like it'll better support chained function calls so that may be a deciding factor for me.