Giter Site home page Giter Site logo

Comments (12)

ranjithshegde avatar ranjithshegde commented on May 20, 2024 1

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.

theHamsta avatar theHamsta commented on May 20, 2024

Could you try #51? This only applies to the textobject.move module right?

from nvim-treesitter-textobjects.

ranjithshegde avatar ranjithshegde commented on May 20, 2024

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.

theHamsta avatar theHamsta commented on May 20, 2024

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.

ranjithshegde avatar ranjithshegde commented on May 20, 2024

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.

ranjithshegde avatar ranjithshegde commented on May 20, 2024

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.

theHamsta avatar theHamsta commented on May 20, 2024

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.

ranjithshegde avatar ranjithshegde commented on May 20, 2024

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:

  1. Open a buffer with lots of functions/classes/symbols to jump around in
  2. execute the textobject.move jumps
  3. check :jumps to see if these are added (it wont have)
  4. exit session
  5. 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.

theHamsta avatar theHamsta commented on May 20, 2024

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.

ranjithshegde avatar ranjithshegde commented on May 20, 2024

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.

theHamsta avatar theHamsta commented on May 20, 2024

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.

theHamsta avatar theHamsta commented on May 20, 2024

It will be automatically closed once the PR is merged.

from nvim-treesitter-textobjects.

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.