windows.nvim icon indicating copy to clipboard operation
windows.nvim copied to clipboard

Autowidth is troublesome with plugins like diffview

Open Raekh opened this issue 2 years ago • 5 comments

Some plugins do not necessarily create entire filetypes or buftypes, making it difficult to accurately pinpoint situations where we don't want the plugin to change that. Such example is easily seen with diffview.

Raekh avatar Sep 19 '22 16:09 Raekh

I know this doesn't really solve the underlying issue but I think specifying a custom filetype is good practice for plugins and the author of diffview should also add this.

smjonas avatar Sep 19 '22 19:09 smjonas

I'm bodging my way around this specific issue with:

  function DiffviewToggle()
    local lib = require("diffview.lib")

    local view = lib.get_current_view()
    if view then
      -- Current tabpage is a Diffview; close it
      vim.cmd(":DiffviewClose")
      vim.cmd(":WindowsEnableAutowidth")
    else
      -- No open Diffview exists: open a new one
      vim.cmd(":WindowsDisableAutowidth")
      vim.cmd(":DiffviewOpen")
    end
  end

  map("n", "<leader>df", ":lua DiffviewToggle()<CR>")

cwqt avatar Sep 20 '22 21:09 cwqt

I get a similar issue with toggleterm :|

nvim freaks out

great plugin though

andoArbST avatar Sep 20 '22 22:09 andoArbST

I'm also experiencing problems with toggleterm. It's a really cool plugin so I hope this gets fixed.

d-3nnis avatar Oct 07 '22 23:10 d-3nnis

I will, but now I'm busy

anuvyklack avatar Oct 08 '22 09:10 anuvyklack