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

Improper cursor position for multichar unicode #465

Closed
Owen000 opened this issue Jul 4, 2024 · 3 comments · Fixed by #470
Closed

Improper cursor position for multichar unicode #465

Owen000 opened this issue Jul 4, 2024 · 3 comments · Fixed by #470

Comments

@Owen000
Copy link

Owen000 commented Jul 4, 2024

Describe the bug
I am still experiencing the issue that was solved here:
#422
multibyte chars move my cursor to the improper positioning.

To Reproduce
Steps to reproduce the behavior:

  1. touch repro.lua
  2. paste in
local root = vim.fn.fnamemodify("./repro", ":p")
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

local lazypath = root .. "/plugins/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",
    lazypath,
  })
end
vim.opt.runtimepath:prepend(lazypath)

local plugins = {
  {
    "nvimdev/dashboard-nvim",
    event = "VimEnter",
    opts = function()
      local opts = {
        theme = "doom",
        config = {
          header = {
            "                                                       ",
            "                                                       ",
            "                                                       ",
            " ███╗   ██╗ ███████╗ ██████╗  ██╗   ██╗ ██╗ ███╗   ███╗",
            " ████╗  ██║ ██╔════╝██╔═══██╗ ██║   ██║ ██║ ████╗ ████║",
            " ██╔██╗ ██║ █████╗  ██║   ██║ ██║   ██║ ██║ ██╔████╔██║",
            " ██║╚██╗██║ ██╔══╝  ██║   ██║ ╚██╗ ██╔╝ ██║ ██║╚██╔╝██║",
            " ██║ ╚████║ ███████╗╚██████╔╝  ╚████╔╝  ██║ ██║ ╚═╝ ██║",
            " ╚═╝  ╚═══╝ ╚══════╝ ╚═════╝    ╚═══╝   ╚═╝ ╚═╝     ╚═╝",
            "                                                       ",
            "                                                       ",
            "                                                       ",
            "                                                       ",
          },
          center = {
            {
              icon = "󰈞  ",
              desc = "Find File                              ",
              action = function()
                require("telescope.builtin").find_files()
              end,
              key = "<Leader> p f",
            },
            {
              icon = "󰈢  ",
              desc = "Recently opened files                   ",
              action = function()
                require("telescope.builtin").oldfiles()
              end,
              key = "<Leader> p o",
            },
            {
              icon = "  ",
              desc = "Open Nvim config                        ",
              action = function()
                require("telescope.builtin").find_files({ cwd = vim.fn.expand("~/.config/nvim") })
              end,
              key = "<Leader> e c",
            },
            {
              icon = "  ",
              desc = "New file                                ",
              action = "enew",
              key = "e",
            },
            {
              icon = "󰗼  ",
              desc = "Quit Nvim                               ",
              action = "qa",
              key = "q",
            },
          },
        },
      }
      return opts
    end,
  },
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})


  1. nvim -u repro.lua
  2. run :Dashboard and hit j 2 times, you will see the issue on the "gear" icon and the "one file" icon.

Expected behavior
Not moving my cursor further

Screenshots
Undesired behavior:
image

Desired behavior
image
(being on the first letter)

@Owen000
Copy link
Author

Owen000 commented Jul 7, 2024

Interesting note, I found that if I set the very topmost icon (Find File) to  (the gear icon that had the issue) it doesn't break.

@polirritmico
Copy link
Contributor

I could reproduce it

@polirritmico
Copy link
Contributor

Fixed by #470

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

Successfully merging a pull request may close this issue.

2 participants