Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indentation broken after b'{' #75

Open
ghost opened this issue Nov 3, 2020 · 2 comments
Open

Indentation broken after b'{' #75

ghost opened this issue Nov 3, 2020 · 2 comments

Comments

@ghost
Copy link

ghost commented Nov 3, 2020

I ran a git bisect and it seems like since commit 8d58bf4 back in 2016 this plugin breaks indentation after a byte string with an unclosed {, such as b'{', resulting in the following indentation:

if license.startswith(b'{'):
        print('json license')
        else:
        print('regular license')

I have no idea how a syntax highlighting plugin breaks this, but it does.

Reproduced on Debian 10 x64 and NVIM v0.5.0-799-g186ba3b68 with minimal init.vim:

call plug#begin('~/.config/nvim/plugged')
Plug 'vim-python/python-syntax'
call plug#end()
@nfnty
Copy link
Member

nfnty commented Dec 2, 2020

I have currently no clue why this occurs, but the issue disappears when you remove all the contains= from pythonBytes at L171-L174. Seems to also still work if you only keep contains=@Spell.

ghost pushed a commit to lunaynx/python-syntax that referenced this issue Jul 11, 2021
@martician1
Copy link

Same problem here with b'[',
without python-syntax:

s = b'check indent ['
# <---------------------- when i press enter my cursor ends up here.

with python-syntax:

s = b'check indent ['
                    # <---------------------- when i press enter my cursor ends up here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants