Code Monkey home page Code Monkey logo

Comments (7)

kbrose avatar kbrose commented on June 19, 2024

Good use case, good write up. Thanks for the issue!

I specifically have the extension set to not run when there is text highlighted (see the !editorHasSelection portion), but to be honest I don't remember why. Maybe it doesn't delete the highlighted text if my extension runs in that case?

I imagine most of the time spent on this issue will be trying to figure out what poor behaviors come from allowing it to run when text is highlighted, and how to mitigate them.

from vsc-python-indent.

kbrose avatar kbrose commented on June 19, 2024

Minor nitpick, shouldn't the desired behavior be

my_dict = {'a': 1,
           'b': 2}
# No trailing space and code is aligned

instead of

my_dict = {'a': 1,
                  'b': 2}
# No trailing space and code is aligned

?

from vsc-python-indent.

WhistleWhileYouWork avatar WhistleWhileYouWork commented on June 19, 2024

Yikes! That is NOT how it looked when I submitted or previewed it. Now when I go to edit it, I have to take off spaces and check the preview to make sure it's aligned. The two views are not the same! Very strange. I guess I'm going to have to double-check the post after posting too.

from vsc-python-indent.

WhistleWhileYouWork avatar WhistleWhileYouWork commented on June 19, 2024

I'm surprised you didn't document that. Your documentation is very thorough.

I specifically have the extension set to not run when there is text highlighted

I can change that setting in my package.json for your extension and test it out and provide feedback.

I think the reason my alignment for the code was off is because the font is not fixed-width. Any idea how to change that? It should be a GitHub setting now a browser one.

from vsc-python-indent.

WhistleWhileYouWork avatar WhistleWhileYouWork commented on June 19, 2024

OK after removing !editorHasSelection and !editorHasMultipleSelections from lines 32 and 37 of package.json, the space from the beginning of the selection on the first line to the end of the selection on the new line is still highlighted.

The pipes and dots in between represent the highlighted section:

my_dict = {'a': 1,|
..........|'b': 2}

from vsc-python-indent.

WhistleWhileYouWork avatar WhistleWhileYouWork commented on June 19, 2024

It turns out the selected text wasn't even being deleted (since the extension was now responsible for doing it). All that was needed was 4 lines of code at the beginning to delete the selection first. I submitted a pull request.

from vsc-python-indent.

kbrose avatar kbrose commented on June 19, 2024

This should now work correctly in version 1.1.0. Please upgrade and re-open if the issue persists.

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.