Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange behavior with macro "dd" when rows are identical #26

Open
premell opened this issue Feb 26, 2023 · 0 comments
Open

Strange behavior with macro "dd" when rows are identical #26

premell opened this issue Feb 26, 2023 · 0 comments

Comments

@premell
Copy link

premell commented Feb 26, 2023

So this behavior is kinda hard to explain and i dont fully understand it myself. Basically when saving "dd" to a macro it behaves very weirdly when the text is the same. It starts from the second to last row and goes up. When i changed to only a few rows being the same it started from the last of the similar rows and counted upwards. Once it had finished it started going down as normal

A bonus bug i found is that if you have recorded "dd" to q and then override it (for example i wrote "testing" at the end of the line), the preview will show both the previous macro to delete and the new macro. Although when you click enter the result is as you expect, but the preview is wrong.

Lastly I am sorry that i didnt have screenkey. I couldnt get it to work on fedora wayland :/ You have to take my word that i recorded "dd"

Screencast.from.2023-02-26.17-45-56.webm

this is the minimal example i used (thank god for NVIM_APPNAME)

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "https://github.com/folke/lazy.nvim.git",
    "--branch=stable", -- latest stable release
    lazypath,
  })
end
vim.opt.rtp:prepend(lazypath)

vim.g.mapleader = " " -- make sure to set `mapleader` before lazy so your mappings are correct

require("lazy").setup({
	{"smjonas/live-command.nvim",
  opts = {
    commands = {
      Norm = { cmd = "norm" },
      Reg = {
        cmd = "norm",
        -- This will transform ":5Reg a" into ":norm 5@a"
        args = function(opts)
          return (opts.count == -1 and "" or opts.count) .. "@" .. opts.args
        end,
        range = "",
      },
    },
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant