folke / which-key.nvim

💥 Create key bindings that stick. WhichKey helps you remember your Neovim keymaps, by showing available keybindings in a popup as you type.
Apache License 2.0
5.25k stars 165 forks source link

bug: coloring messed up starting from column 2 if wide characters are used #597

Closed roylez closed 2 months ago

roylez commented 5 months ago

Did you check docs and existing issues?

Neovim version (nvim -v)

4433e5e

Operating system/version

MacOS 14.2.1

Describe the bug

screenshot 2024 04 23 1135

Steps To Reproduce

  1. Touch a .taskpaper file.
  2. Open it and press <leader>t

Expected Behavior

It should color text like it does for column 1.

Repro

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
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)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  { "folke/which-key.nvim", config = true },
  -- add any other plugins here
  {                                                                                                                                                                                                                 
    "davidoc/taskpaper.vim",                                                                                                                                                                                        
    ft = 'taskpaper',                                                                                                                                                                                               
    dependencies = {                                                                                                                                                                                                
      "folke/which-key.nvim",                                                                                                                                                                                       
    },                                                                                                                                                                                                              
    config = function()                                                                                                                                                                                             

      vim.g["task_paper_search_hide_done"] = 1                                                                                                                                                                      
      vim.g["no_taskpaper_maps"] = 1                                                                                                                                                                                

      local wk = require("which-key")                                                                                                                                                                               

      wk.register({                                                                                                                                                                                                 
        t = {                                                                                                                                                                                                       
          name = 'TaskPaper',                                                                                                                                                                                       
          t = { ":call taskpaper#toggle_tag('today', '')<CR>", '标注 @today' },                                                                                                                                     
          T = { ":call taskpaper#search_tag('today')<CR>",     '显示当日' },                                                                                                                                        
          D = { ":call taskpaper#archive_done()<CR>",          '归档' },                                                                                                                                            
          s = { ":call taskpaper#search()<CR>",                '搜索...' },                                                                                                                                         
          d = {                                                                                                                                                                                                     
            function()                                                                                                                                                                                              
              if vim.api.nvim_call_function('taskpaper#has_tag', { 'done' }) == 1 then                                                                                                                              
                vim.api.nvim_call_function('taskpaper#delete_tag', { 'done' })                                                                                                                                      
              else                                                                                                                                                                                                  
                vim.api.nvim_call_function('taskpaper#delete_tag', { 'today' })                                                                                                                                     
                vim.api.nvim_call_function('taskpaper#add_tag', { 'done', '' })                                                                                                                                     
              end                                                                                                                                                                                                   
            end, '标注 @done' },                                                                                                                                                                                    
        }                                                                                                                                                                                                           
      },{ prefix = '<leader>' })                                                                                                                                                                                    

    end,
  }
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here
github-actions[bot] commented 3 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.