buffer-tree-explorer icon indicating copy to clipboard operation
buffer-tree-explorer copied to clipboard

Set width of explorer to a maximum width and allow to shrink down depending on length of paths

Open joereynolds opened this issue 5 years ago • 1 comments

https://github.com/el-iot/buffer-tree-explorer/blob/dcc3637058b546baa4ed32ca95ca207a179de463/autoload/buffer.vim#L7

Currently you're using vnew which is fine but it takes up half the available screen space. I think it could be more intelligent and create a new buffer from the width of the open buffers.

For example if my open buffer is:

└─ home
   └─ joe.reynolds
      └─ code
         └─ helloHeaps
            └─ 7-scrolling-camera
               ├─ ◎ Main.hx ⇒ 1
               ├─ • 50 ⇒ 8
               └─ • Player.hx ⇒ 5

Then really, the width should be the longest line on this buffer (I think 34). It'd make sense to constrain this too so you don't get ridiculously small or big buffers.

Just a thought

joereynolds avatar Feb 10 '21 11:02 joereynolds

Oh good idea - I've actually been using camspiers/lens.vim while using the plugin so I hadn't noticed the issue. I'll see if I can add some native support for sensible window-sizing.

el-iot avatar Feb 10 '21 11:02 el-iot