Giter Site home page Giter Site logo

Comments (4)

mickeynp avatar mickeynp commented on September 21, 2024 1

This is now fixed in master, as it uses combobulate's proffer interface for presenting choices. (though that may indeed throw up other bugs!)

from combobulate.

mickeynp avatar mickeynp commented on September 21, 2024

Can you supply an example where it "picks up" stray code?

from combobulate.

jdtsmith avatar jdtsmith commented on September 21, 2024

Sure:

def foo():
 [X]if True:
        x = 1
    if not True:
        x = 2

Hit Tab at the [X]:

def foo():
if True:
    x = 1
    if not True:
        x = 2

Hit Tab again and the bottom if block gets swept into the indent:

def foo():
    if True:
        x = 1
        if not True:
            x = 2

I note that the region is not active after each of these indent commands, despite combobulate-python-indent-mark-region=t. If I explicitly mark the region, it constrains the indent as expected. So perhaps the region not remaining active is the issue.

Couple other small points:

  • By default, python-indent-line starts with "no change", which means Tab returns you to the current indentation if not already there, leaving indent unchanged. Maybe this could be construed is a mis-feature, but I bet a lot of people are used to it (including me).
  • It would be preferable if indent commands preserved column position with respect to the text they are indenting. I.e. after the second Tab above, point is left at the beginning of the line (instead of at column 4, adjacent to the text it just indented). Again, this is the behavior of python-indent-line.

Thanks for your work on combobulate!

from combobulate.

mickeynp avatar mickeynp commented on September 21, 2024

Huh, I never tweaked this behaviour before. Thanks for reporting it

I'll see about using the region properly; ditto the marking, which of course should work, whether it's visible or not.

from combobulate.

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.