Giter VIP home page Giter VIP logo

Comments (5)

kbrose avatar kbrose commented on June 16, 2024

Thanks for the issue. Definitely not desired behavior.

I think one possible solution is to always trim whitespace to the right of the cursor before going into any of the additional logic, I'm just trying to think if there are legitimate use cases where we'd want to preserve that whitespace...

from vsc-python-indent.

MatthewFlamm avatar MatthewFlamm commented on June 16, 2024

To add to this, can it trim the whitespace if done this way?

result = my_func(first_argument, second_keyword=some_value1, |third_keyword=some_value2)

The desired result as in the initial post:

# Following line has no whitespace at the end
result = my_func(first_argument, second_keyword=some_value1,
                |third_keyword=some_value2)

The current behavior results in:

# Following line has a whitespace at the end
result = my_func(first_argument, second_keyword=some_value1, 
                |third_keyword=some_value2)

from vsc-python-indent.

doyou89 avatar doyou89 commented on June 16, 2024

To add to this, can it trim the whitespace if done this way?

result = my_func(first_argument, second_keyword=some_value1, |third_keyword=some_value2)

The desired result as in the initial post:

# Following line has no whitespace at the end
result = my_func(first_argument, second_keyword=some_value1,
                |third_keyword=some_value2)

The current behavior results in:

# Following line has a whitespace at the end
result = my_func(first_argument, second_keyword=some_value1,<space>
                |third_keyword=some_value2)

In the above case, I think It should be left as it is intended.

from vsc-python-indent.

kbrose avatar kbrose commented on June 16, 2024

@MatthewFlamm I prefer to defer tasks like that to VSCode's files.trimTrailingWhitespace setting:

When enabled, will trim trailing whitespace when saving a file.

from vsc-python-indent.

kbrose avatar kbrose commented on June 16, 2024

@doyou89 This should now be fixed. Make sure you upgrade to version 1.12.0 (or later) of the package.

If you have any issues with the behavior, please comment here or open a new issue.

Thank you for your patience!

from vsc-python-indent.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.