Giter VIP home page Giter VIP logo

Comments (5)

deifactor avatar deifactor commented on June 26, 2024 2

Hmm, I didn't know that ci" works like that. In that case this behavior makes more sense. A new parameter to evil-textobj-tree-sitter-get-textobj could work, maybe with an option that sets the default.

The reason I ran into this was that I was running into some issues with the queries; for example, some_function(1234) doesn't match the 'outer parameter' query since there's no trailing comma; I saw the cursor zooming off elsewhere and thought there was some weird issue computing the character positions.

IMO outer objects should fall back to inner objects if the inner exists and the outer doesn't, but I'm not sure if you agree. Separate issue anyway.

BTW, thanks for this library; when I've got a bit more free time I'd love to help. :)

from evil-textobj-tree-sitter.

meain avatar meain commented on June 26, 2024 1

I gave it some thought and decided to merge a global flag.
You now have: (setq evil-textobj-tree-sitter-use-next-if-not-within nil).

from evil-textobj-tree-sitter.

meain avatar meain commented on June 26, 2024

This is done so as to mimic how ci" or cib works. That said, I'm not opposed to adding a flag that can switch off the behaviour.

from evil-textobj-tree-sitter.

meain avatar meain commented on June 26, 2024

I'm also wondering if this should be specific to each textobj, ie things lie arguments could have this limit, but maybe not for functions. Do you have any thoughts around this?

from evil-textobj-tree-sitter.

meain avatar meain commented on June 26, 2024

A new parameter to evil-textobj-tree-sitter-get-textobj could work, maybe with an option that sets the default.

I think that makes sense.

MO outer objects should fall back to inner objects if the inner exists and the outer doesn't, but I'm not sure if you agree. Separate issue anyway.

I don't wanna force it on users, but you can provide multiple capture groups if you would like it to match both inner and outer.

  (define-key evil-outer-text-objects-map "q" (evil-textobj-tree-sitter-get-textobj ("conditional.outer" "conditional.inner")))

from evil-textobj-tree-sitter.

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.