Open clouddistortion opened 4 years ago
Please provide a full example that (does not) work(s) by itself. The above is not valid Python code, and the next line's indent is 1 as expected.. ;)
For sure :)
Here a working example code.
def some_function():
id=1
d="somestring"
LINE_BREAK="\n"
rendered_result = 'System_Boundary({id},"{descr}") {{'.format(id=id,descr=d) + LINE_BREAK
return rendered_result
print(some_function())
If text is being added after the some_function method it will be indented approx. 58-60 spaces to right
Works for me. Is the "{{" recognized as "pythonString" with your syntax highlighting? This should take care of skipping it: https://github.com/Vimjas/vim-python-pep8-indent/blob/b3a7395ce49b13145bbb54b1cdbfe6a33585bfe9/indent/python.vim#L369
I think it s interpreted as a variable
even a simple S="{{"
provokes a file indent on the next line
Appears to be an issue with your syntax file then.
Looks like it delegates to some other syntax maybe?
What does :echo reverse(map(synstack(line("."), col(".")), 'synIDattr(v:val,"name")'))
display? (or zS
with vim-scriptease)
if the cursors location is in the string with the two curly brackets it displays:
['pythonStrFormat', 'pythonString']
So that should be ok. But there's another method used to check/skip this after all. Can you try https://github.com/Vimjas/vim-python-pep8-indent/pull/133, please? What syntax plugin/file are you using?
I am using the configuration of https://vim.fisadev.com/ at https://raw.githubusercontent.com/fisadev/fisa-vim-config/master/config.vim
works great!
Cool! Will have to check this with regard to slower performance now maybe (and adding a test), but good to know already that it works.
Hi, I am escaping a curly bracket in a string and after that line of code the indention breaks and runs mad.
id=1 d="somestring" LINEBREAK="\n" rendered_result = 'System_Boundary({id},"{descr}") {{'.format(id=id,descr=d) + LINE_BREAK
The following line indention is 62 characters long