tweekmonster / impsort.vim

Sort and highlight Python imports in Vim
MIT License
37 stars 6 forks source link

Issue when having `from` in string #10

Closed petobens closed 8 years ago

petobens commented 8 years ago

Consider the following foo.py file:

platform_statement = """SELECT platform
FROM mysql.ruby.applications
WHERE id = {app_id}
""".format(app_id=12)

When I run :ImpSort I get:

platform_statement = """SELECT platform
WHERE id = {app_id}
""".format(app_id=12)

i.e the FROM line gets deleted. Thanks in advance for looking into this.

tweekmonster commented 8 years ago

I completely forgot about this. I'll look into it in the morning.

petobens commented 8 years ago

Ok. There no is hurry. Thanks!!

petobens commented 8 years ago

Thank you!!

tweekmonster commented 8 years ago

No problem 👍

Quick question: your example above didn't work for me because it was uppercased. The lowercased string did get matched, though. Was the example a mistake?

petobens commented 8 years ago

Mmmm I believe tried it exactly as I wrote it above (I'm pretty sure I originally wrote it uppercased since I generally write sql keywords uppercased).

tweekmonster commented 8 years ago

Well that's strange because I wasn't using case-insensitive patterns. Do you have 'ignorecase' enabled or something?

petobens commented 8 years ago

Yep, I use set ignorecase and set smartcase.

tweekmonster commented 8 years ago

Just tried it. That's the dumbest thing I've ever seen. That should only affect the user's / search. Oh well, it's fixed.

petobens commented 8 years ago

Vim is full of surprises. Thanks once again. :)