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

Problem with list of strings and long strings #134

Open
FantasticMrFux opened this issue Feb 20, 2020 · 2 comments
Open

Problem with list of strings and long strings #134

FantasticMrFux opened this issue Feb 20, 2020 · 2 comments

Comments

@FantasticMrFux
Copy link

Maybe my problem hast to do with my lack of understanding of the pep8 standards.
So if I have a list of strings like this:

list_of_strings = ["Affy ID", "Agilent ID", "Allergome Code", "longerrrrrrrrrr ID", "ID", "WormPep Protein ID", "XenBase Gene ID", "ZFIN ID"]

when i gq I get the following result

list_of_strings = ["Affy ID", "Agilent ID", "Allergome Code", "longerrrrrrrrrr
                   ID", "ID", "WormPep Protein ID", "XenBase Gene ID", "ZFIN
                   ID"]

Which breaks my code

  File "./t.py", line 3
    list_of_strings = ["Affy ID", "Agilent ID", "Allergome Code", "longerrrrrrrrrr
                                                                                 ^
SyntaxError: EOL while scanning string literal

And under my understanding it should indent the line like so:

list_of_strings = ["Affy ID", "Agilent ID", "Allergome Code",
                   "longerrrrrrrrrr ID", "ID", "WormPep Protein ID",
                   "XenBase Gene ID", "ZFIN ID"]

Second assuming I have this string:

string = "Affy ID Agilent ID Allergome Code longerrrrrrrrrr ID ID WormPep Protein ID XenBase Gene ID ZFIN ID"

results in

string = "Affy ID Agilent ID Allergome Code longerrrrrrrrrr ID ID WormPep
Protein ID XenBase Gene ID ZFIN ID"

I would assume that it should like so:

string = ("Affy ID Agilent ID Allergome Code longerrrrrrrrrr ID ID WormPep"
          "Protein ID XenBase Gene ID ZFIN ID")

So what do I not understand?
Is there an option to stop vim-python-pep8-indent from wrapping in between strings?

@FantasticMrFux FantasticMrFux changed the title Problem with list of strings is broke at whitespaces and long strings Problem with list of strings and long strings Feb 20, 2020
@david-drinn
Copy link

david-drinn commented Jul 9, 2024

Yes, well identified with good examples. I have the same problem, and it basically makes this plugin unusable as-is.

@david-drinn
Copy link

david-drinn commented Jul 9, 2024

I worked around this in my case, by essentially no longer using the textwidth option. I was setting it to 79 in my personal config. The bundle I'm using sets the default to 500. This means it effectively never triggers, since I almost never have lines that long.

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

No branches or pull requests

2 participants