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

[Bug]: It only show one dropbar when using diff-mode #135

Closed
ofseed opened this issue Jan 31, 2024 · 3 comments · Fixed by #137
Closed

[Bug]: It only show one dropbar when using diff-mode #135

ofseed opened this issue Jan 31, 2024 · 3 comments · Fixed by #137
Labels
bug Something isn't working

Comments

@ofseed
Copy link
Contributor

ofseed commented Jan 31, 2024

Description

By start Neovim with:

nvim --clean -u minimal.lua -d file1.txt file2.txt

Only the right side will show dropbar.
image

nvim version

NVIM v0.10.0-dev-2246+gf4b3636f2 Build type: Release LuaJIT 2.1.1706185428

dropbar.nvim version

9a8e498

Operating system and version

Linux 5.15.133.1-microsoft-standard-WSL2 x86_64 GNU /Linux

Minimal config

local tmp = vim.env.TMPDIR
  or vim.env.TEMPDIR
  or vim.env.TMP
  or vim.env.TEMP
  or '/tmp'
local data = tmp ..  '/' .. (vim.env.NVIM_APPNAME or 'nvim')
local packages_root = data .. '/site'
local cloned_root = packages_root .. '/pack/packages/start'
local cloned_path = cloned_root .. '/dropbar.nvim'
local url = 'https://github.com/Bekaboo/dropbar.nvim.git'

vim.fn.mkdir(cloned_root, 'p')
vim.opt.pp:prepend(packages_root)
vim.opt.rtp:prepend(packages_root)

if not vim.loop.fs_stat(cloned_path) then
  vim.fn.system({ 'git', 'clone', url, cloned_path })
end

require('dropbar').setup()

Steps to reproduce

Same with the description.

Expected behavior

It should show dropbar on both sides of the window.

Actual behavior

dropbar only shows on the right side of the window.

Additional information

No response

@ofseed ofseed added the bug Something isn't working label Jan 31, 2024
@Bekaboo
Copy link
Owner

Bekaboo commented Feb 3, 2024

See opts.general, you can change opts.general.enable to attach winbar to buffer in diff mode:

function(buf, win)
  return not vim.api.nvim_win_get_config(win).zindex
  and vim.bo[buf].buftype == ''
  and vim.api.nvim_buf_get_name(buf) ~= ''
end

@Bekaboo Bekaboo closed this as completed Feb 3, 2024
@ofseed
Copy link
Contributor Author

ofseed commented Feb 4, 2024

I didn't expect that the defaults specifically prevent it from being displayed in the diff. I would like to inquire, what is the rationale behind this design?

@Bekaboo
Copy link
Owner

Bekaboo commented Feb 4, 2024

@ofseed It was (originally) intended to avoid exactly this case (winbar attaching to only one of the windows when multiple windows are in diff mode) but is now outdated. I will update the config and use a saner default function to determine whether we should attach dropbar to specific windows/buffers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants