Coder Social home page Coder Social logo

Comments (13)

perrin4869 avatar perrin4869 commented on August 18, 2024 1

Hasn't happened in a while

from nvim-treeclimber.

Dkendal avatar Dkendal commented on August 18, 2024 1

I'll take a look this week and see if I can replicate.

from nvim-treeclimber.

Dkendal avatar Dkendal commented on August 18, 2024

Thanks for reporting @perrin4869!

from nvim-treeclimber.

perrin4869 avatar perrin4869 commented on August 18, 2024

sorry, still happening πŸ˜…

from nvim-treeclimber.

perrin4869 avatar perrin4869 commented on August 18, 2024

One other thing that I noticed is, sometimes immediately after running select_expand a few times, if I press a command such as d to delete the selected text, or = to indent it, instead of running the command, it will be replaced by the pressed key (it's as if I'd pressed sd in the first case, or s= in the second).

from nvim-treeclimber.

Dkendal avatar Dkendal commented on August 18, 2024

Interesting, would you be able to test if this happens with other plugins disabled, just to rule that out?

from nvim-treeclimber.

perrin4869 avatar perrin4869 commented on August 18, 2024

Sure, I really should try to figure out how to reproduce it ^^;;
It's been happening in some Kotlin files, just can't reproduce it right now for some reason again πŸ˜“
btw, the issue I described above, if before the command I press V, then the command, it would work as expected...

from nvim-treeclimber.

Dkendal avatar Dkendal commented on August 18, 2024

from nvim-treeclimber.

perrin4869 avatar perrin4869 commented on August 18, 2024

Always on the second call

from nvim-treeclimber.

perrin4869 avatar perrin4869 commented on August 18, 2024

ok, I managed to reproduce!!

take this file, foo.kt:

package com.nvim.treehopper.reproduction

class MyClass {

    class Fixture {

        data class Fixture() {

            fun execute(parameters: Map<String, String>, status: HttpResponseStatus = HttpResponseStatus.SEE_OTHER) {}
        }
    }
}

If you put your cursor, say, anywhere on execute (actually, anywhere on the line seems to work), then hit <S-v><M-k><M-k><M-k>, the file will change to:

package com.nvim.treehopper.reproduction

class MyClass {

    class Fixture {

        data class fixture() {

            gk
        }
    }
}

Sorry for the contrived example, but it's not easy to reproduce ^^;;
Sorry, it's not always on the second call, sometimes it's the third call, also I don't think it's a race condition, because the timing of the keystrokes doesn't seem to affect the outcome

Edit: I confirmed this will happen also inside typescript and lua files. I couldn't find a way to reproduce without running <S-v> first, but the issue did occur before under different conditions

from nvim-treeclimber.

Dkendal avatar Dkendal commented on August 18, 2024

@perrin4869 What's <s-v> mapped to in your config?

from nvim-treeclimber.

perrin4869 avatar perrin4869 commented on August 18, 2024

Largely copied the setup from the readme:

local tc = require("nvim-treeclimber")

-- Keymaps
vim.keymap.set("n", "<leader>k", tc.show_control_flow, {})
vim.keymap.set({ "x", "o" }, "i.", tc.select_current_node, { desc = "select current node" })
vim.keymap.set({ "x", "o" }, "a.", tc.select_expand, { desc = "select parent node" })
vim.keymap.set(
	{ "n", "x", "o" },
	"<M-e>",
	tc.select_forward_end,
	{ desc = "select and move to the end of the node, or the end of the next node" }
)
vim.keymap.set(
	{ "n", "x", "o" },
	"<M-b>",
	tc.select_backward,
	{ desc = "select and move to the begining of the node, or the beginning of the next node" }
)

vim.keymap.set({ "n", "x", "o" }, "<M-[>", tc.select_siblings_backward, {})
vim.keymap.set({ "n", "x", "o" }, "<M-]>", tc.select_siblings_forward, {})
vim.keymap.set(
	{ "n", "x", "o" },
	"<M-g>",
	tc.select_top_level,
	{ desc = "select the top level node from the current position" }
)
vim.keymap.set({ "n", "x", "o" }, "<M-h>", tc.select_backward, { desc = "select previous node" })
vim.keymap.set({ "n", "x", "o" }, "<M-j>", tc.select_shrink, { desc = "select child node" })
vim.keymap.set({ "n", "x", "o" }, "<M-k>", tc.select_expand, { desc = "select parent node" })
vim.keymap.set({ "n", "x", "o" }, "<M-l>", tc.select_forward, { desc = "select the next node" })
vim.keymap.set({ "n", "x", "o" }, "<M-L>", tc.select_grow_forward, { desc = "Add the next node to the selection" })
vim.keymap.set({ "n", "x", "o" }, "<M-H>", tc.select_grow_backward, { desc = "Add the next node to the selection" })

Edit: ah, <S-v> is not mapped to anything, it's just for selecting a whole line

from nvim-treeclimber.

Related Issues (8)

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.