Comments (12)
Thank you for the help with gitter! I will create an issue on neovim later today. Also for this feature!
Shall I close?
from nvim-treesitter-textobjects.
Could you try #51? This only applies to the textobject.move
module right?
from nvim-treesitter-textobjects.
yes, it is for textobject.move
Thank you so much not only for the PR but also the speed of it!
EDIT:---
@theHamsta I was wrong. Now it still does add to jumps (even with set_jumps = false) just does not add it immediately
from nvim-treesitter-textobjects.
What do you mean by immediatelly
? Maybe there is something that implicitly sets jumps.
The PR only avoids to call https://github.com/theHamsta/nvim-treesitter/blob/06a6510637352251b1d43a1e81d3a9d951cfd0a5/lua/nvim-treesitter/utils.lua#L132-L134 explicitly. Can you check whether this line still gets called on your machine?
We use nvim_win_set_cursor
which does not set jump on my machine (at least does not consider the textobject.move commands). Would :h setpos
here (https://github.com/theHamsta/nvim-treesitter/blob/06a6510637352251b1d43a1e81d3a9d951cfd0a5/lua/nvim-treesitter/ts_utils.lua#L302) change the behavior for you that has in its doc that it does not set jumps.
from nvim-treesitter-textobjects.
By immediately I mean the "normal" jump lists are set as and when the jumps happen. But with the feature of the PR, (textobject.move with set_jumps=false), the jumplist for the move is updated only when I exit the buffer, not until then.
I will check for the call in a few hours!
from nvim-treesitter-textobjects.
Can you check whether this line still gets called on your machine?
Just added an echo to it to see whether it gets called. With the set_jumps set to false, it does not call the function! and it calls when set to true! so it is working as desired.
It is strange that it still updates the jump list, only on buffer exit
from nvim-treesitter-textobjects.
I'm really not an expert on how this works. Is there a sequence of commands on how o can reproduce this so I can ask about it (nvim_set_cursor) at Nvim gitter?
Do you have the same problem when you just call nvim_set_cursor instead of the text object movements?
from nvim-treesitter-textobjects.
I'm really not an expert on how this works. Is there a sequence of commands on how o can reproduce this so I can ask about it (nvim_set_cursor) at Nvim gitter?
I honestly dont know how to reproduce it as its not always consistent. For what its worth, I would do these:
- Open a buffer with lots of functions/classes/symbols to jump around in
- execute the textobject.move jumps
- check :jumps to see if these are added (it wont have)
- exit session
- open vim, same or different session/buffer and check :jumps. good chance it would have updated the said jumps
Do you have the same problem when you just call nvim_set_cursor instead of the text object movements?
Sorry but i dont know how to call nvim_win_set_cursor(opts). if you mean the default vim jumps such as ]], ]} etc.. then they dont have this problem. they update/add to jump list immediately when called/jumped
from nvim-treesitter-textobjects.
This is the only move related function that we are calling (second argument cursor pos)
:lua vim.api.nvim_win_set_cursor(0, {2,2})
When you can reproduce your issue only by calling this function then it's likely a Neovim issue.
I can't reproduce your issue. I never see any jumps with :jumps
when set_jumps = false
. For me it only sets a jump at the exact position where you exited nvim
from nvim-treesitter-textobjects.
you are right! I can reproduce calling the _set_cursor(args) function.
I suppose its a neovim issue.
Then your PR works wonderfully!
Thank you
from nvim-treesitter-textobjects.
Maybe you open an issue at Neovim. I'm sure they can help you much more than I. I'll ask on gitter whether this function is supposed to set any jumps.
from nvim-treesitter-textobjects.
It will be automatically closed once the PR is merged.
from nvim-treesitter-textobjects.
Related Issues (20)
- [Question] How to jump to next argument without going into nested function calls
- Parameter.outer grabs too much in Ruby HOT 3
- Text object @parameter does not work after undo with `u` HOT 1
- What is the same config as nvim-treesitter's original `incremental_selection`? HOT 1
- Refactor into standalone plugin HOT 4
- [Question] Which commit is usable for neovim v0.8.3?
- Inconsistent behavior between delete and select operations for the same text-object
- Opening cpp and zig files will hang for a while. HOT 4
- Broken rust query HOT 4
- [Question] Peeking both @function.outer & @class.outer with the same keybind
- selection_modes not working HOT 1
- inconsistency of selecting @conditional.inner across different languages HOT 1
- Mapping repeating movements as recommended breaks some repeated commands HOT 1
- C/C++ Grammer-related crash when opening file HOT 4
- Question: closures intentionally not captured under function.inner/outer ?
- textobject's select {...} keymaps don't function once timeoutlen is set to 0
- key, value textobjects don't work HOT 4
- FR: Confusion about filetype=sh, and treesitter language bash
- change inside function(@funcion.inner) doesn't work after first time HOT 1
- Is there any way to only select function signaure? HOT 1
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 nvim-treesitter-textobjects.