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

Customizable menu window #46

Merged

Conversation

jesseleite
Copy link
Contributor

@jesseleite jesseleite commented Mar 24, 2021

Default Window

image

Customized Window 💅 💅 💅

require('harpoon').setup {
  menu = {
    width = 50,
    height = 8,
    borderchars = {'!', '@', '$', '%', '^', '&', '*', '|'},
  }
}
highlight HarpoonWindow ctermbg=yellow ctermfg=red
highlight HarpoonBorder ctermbg=yellow ctermfg=red

custom

@jesseleite
Copy link
Contributor Author

jesseleite commented Mar 25, 2021

BTW™, I dug into both plenary.nvim and popup.nvim by Teej, and it seems they both both have pros and cons:

  • Plenary can center the window for you, but doesn't let you customize border, etc.
  • Popup lets you customize border, but you have to center the window yourself.

Just PR'd a few potential improvements to popup.nvim, see:

If those get merged, we can simplify our code to this...

local win_id, win = popup.create(bufnr, {
    title = 'Harpoon',
    highlight = 'HarpoonWindow',
    borderhighlight = 'HarpoonBorder',
    minwidth = config.width or 60,
    minheight = config.height or 10,
    pos = 'center',
    borderchars = config.borderchars or { '', '', '', '', '', '', '', '' },
})

@ThePrimeagen ThePrimeagen merged commit abb717f into ThePrimeagen:master Mar 25, 2021
@jesseleite
Copy link
Contributor Author

Rad thanks @ThePrimeagen 🤘

PS. I'll PR the above simplification if/when my pop.nvim PRs get merged there.

@jesseleite jesseleite deleted the customize-menu-window-yayaya branch March 25, 2021 20:10
@ThePrimeagen
Copy link
Owner

yeah, this is awesome

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 this pull request may close these issues.

2 participants