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

Doesn't work with Python f-strings #211

Open
sloria opened this issue Apr 16, 2018 · 5 comments · May be fixed by #286
Open

Doesn't work with Python f-strings #211

sloria opened this issue Apr 16, 2018 · 5 comments · May be fixed by #286

Comments

@sloria
Copy link

sloria commented Apr 16, 2018

Python f-strings have the following syntax:

user = 'jiangmiao'
repo = 'auto-pairs'
full_repo = f'{user}/{repo}'

When typing f', I would expect the closing ' character to be auto-paired, but it currently does not.

@geewrd
Copy link

geewrd commented Mar 7, 2019

Same here, but it does work with double quotes.

@eyemyth
Copy link

eyemyth commented Dec 12, 2019

au FileType python let b:AutoPairs = AutoPairsDefine({"f'" : "'", "r'" : "'", "b'" : "'"})

@brianjp93
Copy link

This almost works perfectly, except for if your string ends in an f, and you try to close the string it will add another apostrophe to close that one.

@tribela tribela linked a pull request Mar 26, 2020 that will close this issue
@pianocomposer321
Copy link

Same here, but it does work with double quotes.

Weird. Does anybody have any idea why it works for double but not single quotes? Maybe this could be used to fix the issue.

@rolzy
Copy link

rolzy commented Nov 29, 2020

I think this is intended behavior.
https://github.com/jiangmiao/auto-pairs/blob/master/doc/AutoPairs.txt#L57-L60

Skip ' when inside a word: >

        input: foo| (press ' at |)
        output: foo'

One of the features of this plugin is to NOT complete apostrophes while inside a word. Hence, double quotes are not affected

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

Successfully merging a pull request may close this issue.

6 participants