romgrk / barbar.nvim

The neovim tabline plugin.
2.17k stars 82 forks source link

perf: misc #445

Closed Iron-E closed 1 year ago

Iron-E commented 1 year ago

This PR does two things to increase performance:

  1. Only use deepcopy on the default icons, not the whole default options table.
    • We only need to deepcopy at all because the icons are merged together, and sometimes share references to each other.
  2. Only prevent expansion of the final click group if there are click groups in the bufferline.
    • I noticed that, since I have clickable = false in my config, that this was the only click handler in the barbar at all. The reason for it being there is only to prevent bugs when clickable == true, so we can avoid making a new string per render in this case.
Iron-E commented 1 year ago

I put the DEFAULT_OPTIONS back at the top, and added spaces inside the braces