The current python indent plugin relies on 5 global variables for its config:
g:pyindent_continue
g:pyindent_disable_parentheses_indenting
g:pyindent_nested_paren
g:pyindent_open_paren
g:pyindent_searchpair_timeout
This PR consolidates all of them inside a single g:pyindent dictionary variable.
Also, the current plugin indents a multiline dictionary such as:
dict = { 'a': 1, }
Like this:
dict = { 'a': 1, }
Some people might prefer this:
dict = { 'a': 1, }
This is given as an alternative in PEP8.
It seems to be the only way in the Google python style guide.
And it seems to be the default way for the black Python formatter.
This PR adds a new key inside g:pyindent: closed_paren_align_last_line. By default it's true to preserve the old way of aligning closing parens. But when reset to false, the user can get the other type of alignment.
The help is updated, and a test is included.
I'm not sure how reliable it is yet.
https://github.com/vim/vim/pull/10929
(4 files)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Unrelated, but why is the Vim comment leader used inconsistently in html.in?
In particular, there are 2 START_INDENT lines in this file; one is commented with ", the other with %. To be consistent, I think every " used as a comment leader should be replaced with a % character:
diff --git a/runtime/indent/testdir/html.in b/runtime/indent/testdir/html.in index b62c67ddb..4783a096d 100644 --- a/runtime/indent/testdir/html.in +++ b/runtime/indent/testdir/html.in @@ -1,7 +1,7 @@ -" vim: set ft=html sw=4 ts=8 : +% vim: set ft=html sw=4 ts=8 : -" START_INDENT +% START_INDENT <html> <body> <style> @@ -50,7 +50,7 @@ text </body> </html> -" END_INDENT +% END_INDENT % START_INDENT % INDENT_EXE let g:html_indent_style1 = "inc"
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@lacygoill pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
It might be a good idea to take this opportunity to change the prefix to use the filetype prefix as is generally done for these config variables. Both the syntax file and ftplugin are using the python_ prefix. So, pyindent becomes python_indent.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@lacygoill pushed 1 commit.
You are receiving this because you are subscribed to this thread.![]()
@lacygoill pushed 1 commit.
You are receiving this because you are subscribed to this thread.![]()
@lacygoill pushed 1 commit.
You are receiving this because you are subscribed to this thread.![]()
It might be a good idea to take this opportunity to change the prefix to the filetype name as is generally done for these config variables. Both the syntax file and ftplugin are using the python_ prefix. So, pyindent becomes python_indent.
OK, I replaced the pyindent_ prefix with the python_indent dictionary.
It should not matter, but keeping it consistent is nicer.
Maybe it doesn't matter here, but I think I was confused and thought it was OK to use " as a comment leader in the python tests. It turns out that we can't because then the syntax – which the indent plugin sometimes inspects – gets wrong (synIDattr() might unexpectedly return pythonQuotes instead of pythonString).
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Merging #10929 (38db3db) into master (e1f3fd1) will decrease coverage by
0.00%.
The diff coverage isn/a.
@@ Coverage Diff @@ ## master #10929 +/- ## ========================================== - Coverage 82.70% 82.69% -0.01% ========================================== Files 148 148 Lines 173738 173744 +6 Branches 39256 39258 +2 ========================================== Hits 143684 143684 - Misses 17463 17471 +8 + Partials 12591 12589 -2
| Flag | Coverage Δ | |
|---|---|---|
| huge-clang-none | 82.69% <ø> (-0.01%) |
⬇️ |
| linux | 82.69% <ø> (-0.01%) |
⬇️ |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/profiler.c | 82.55% <0.00%> (-0.70%) |
⬇️ |
| src/message.c | 81.09% <0.00%> (-0.25%) |
⬇️ |
| src/term.c | 73.72% <0.00%> (-0.16%) |
⬇️ |
| src/terminal.c | 82.14% <0.00%> (-0.10%) |
⬇️ |
| src/gui_gtk_x11.c | 51.72% <0.00%> (-0.10%) |
⬇️ |
| src/regexp_nfa.c | 88.89% <0.00%> (-0.08%) |
⬇️ |
| src/vim9expr.c | 91.25% <0.00%> (-0.01%) |
⬇️ |
| src/misc2.c | 86.71% <0.00%> (ø) |
|
| src/buffer.c | 84.13% <0.00%> (ø) |
|
| src/normal.c | 90.31% <0.00%> (ø) |
|
| ... and 15 more |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
I have no idea how to resolve the conflicts which started after the latest update of the runtime files. I'll open a new PR later.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Closed #10929.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()