barbar.nvim
barbar.nvim copied to clipboard
Untangling Dependency Cycles
As noted in #270, it seems like we have a dependency cycle (note the double-ended arrows):
The best way I can think to fix this is the following:
- Move
bufferline.render()
,bufferline.update()
,bufferline.update_async()
tobufferline.render
. - Move all methods in
bufferline.state
requiring abufferline.update()
tobufferline.render
- Alternatively: remove calls to
bufferline.update()
frombufferline.state
, and add methods which wrap around them and callbufferline.update()
tobufferline.render
- Alternatively: remove calls to
- Move
bufferline.jump_mode.activate()
tobufferline.render.activate_jump_mode()
(bikeshedding on the name is welcome)
That would make the dependency tree look like the following:
-
bufferline.jump_mode
is now likebufferline.state
but for:BufferPick
— it holds data but doesn't render. -
bufferline.render
now controls all code for rendering and updating&tabline
-
bufferline.state
holds information about state, but now never renders
What are your thoughts?
Graph looks nice :) let's do it when we have time.