Comments (5)
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.
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.
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.
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.
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)
- evil-textobj-tree-sitter--treesit-get-nodes: Wrong type argument: treesit-query-p, nil HOT 2
- Query to get function name from within function body HOT 7
- doesn't work with rustic HOT 2
- loop and conditional textobjects HOT 2
- Emacs treesit experiments HOT 5
- Make builtin treesit and elisp-tree-sitter use same queries
- cpp queries for builtin treesit library inherits c queries from elisp-tree-sitter
- Override `node` with `node.start` if available HOT 1
- Option to swap nodes of same type
- Remove hard dependency on evil-mode HOT 3
- Invalid Query for Java HOT 3
- Add CI to check for grammer rules
- Problems with R HOT 3
- Add support for bulitin tree-sitter along with elisp-tree-sitter HOT 8
- evil-textobj-tree-sitter-get-textobj generate invalid code with multiple bidings
- Add support for additional queries locations HOT 4
- Usage question: How to define a mapping for inner object HOT 1
- Add support for/workaround `#offset` and `#lua-match` predicates HOT 2
- enabling the package without using c-ts-mode? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from evil-textobj-tree-sitter.