weirongxu / coc-explorer

📁 Explorer for coc.nvim
MIT License
1.14k stars 45 forks source link

Floating window layout is broken (sometimes) #473

Closed Nodman closed 2 years ago

Nodman commented 2 years ago

Hi! Thanks for such awesome plugin.

Some time ago I started to notice that from time to time floating window layout becomes broken:

broken:

ok:

coc-settings.json:

{
  ...
  "explorer.keyMappings.global": {
    "<cr>": [
      "expandable?",
      ["expanded?", "collapse", "expand"],
      "open"
    ],
    "v": "open:vsplit",
    "s": "open:split"
  },
  "explorer.file.showHiddenFiles": true,
  "explorer.buffer.tabOnly": true,
  "explorer.icon.enableNerdfont": true,
  "explorer.buffer.showHiddenBuffers": true,
  ...
}

coc-explorer preset:

local fileChildTemplate = {
 '[git | 2]',
 '[selection | clip | 1]',
 '[indent]',
 '[icon | 1] ',
 '[diagnosticError & 1]',
 '[filename omitCenter 1]',
 '[modified]',
 '[readonly]',
 '[linkIcon & 1]',
 '[link growRight 1 omitCenter 5]',
}

vim.g.coc_explorer_global_presets = {
  floating = {
    ['position'] = 'floating',
    ['floating-width'] = 70,
    ['floating-height'] = -1,
    ['file-root-template'] = '[icon] [root]',
    ['file-child-template'] = table.concat(fileChildTemplate),
  },
}

map('n', '<leader>e', '<CMD>CocCommand explorer  --preset floating --sources file+<CR>', silentRemap)

Any ideas what can be cause of such behaviour? Thanks.

weirongxu commented 2 years ago

This issue should be fixed in #472

weirongxu commented 2 years ago

Please try the latest version first

Nodman commented 2 years ago

Will check. Thanks!