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

Automaticall call TilerReorder after NerdTree closes #5

Open
wirtsi opened this issue Jan 10, 2018 · 5 comments
Open

Automaticall call TilerReorder after NerdTree closes #5

wirtsi opened this issue Jan 10, 2018 · 5 comments

Comments

@wirtsi
Copy link

wirtsi commented Jan 10, 2018

Hey ...

do you have any solution to call TilerReorder after I close NerdTree (calling it through toggle).

After it's closed the layout is incorrect and needs to be reordered, I'd love that to happen automatically?

Thanks for the cool plugin, I tries DWM.vim but it was to rough ...

@zhamlin
Copy link
Owner

zhamlin commented Jan 10, 2018

You could just create a new command, that calls both NERDTreeToggle and TilerReorder

@bag-man
Copy link

bag-man commented Feb 6, 2019

I also noticed that if I create a new window with nerdtree open, the order of windows gets mixed up and nerdtree gets pushed to the main panels and my previous window gets put in the nerdtree position. Really frustrating :(

image

@zhamlin Think this is a config issue? The new window was opened with:

nnoremap <C-\> :term<CR><C-w>N:call tiler#reorder()<cr>i

  " Tiler
  tmap <C-q> <C-w>N
  nnoremap + <C-w>3+
  nnoremap _ <C-w>3-
  nnoremap <C-\> :term<CR><C-w>N:call tiler#reorder()<cr>i
  map <C-@> <plug>TilerNew
  let g:tiler#master#size = 20
  let g:tiler#master#count = 1
  let g:tiler#layout = 'bottom'
  let g:tiler#popup#windows = {
  \    'fzf': { 'position': 'bottom', 'size': 10, 'filetype': 'fzf', 'order': 3 },
  \    'nerdtree': { 'position': 'left', 'size': 10, 'filetype': 'nerdtree', 'order': 2 },
  \    'tagbar': { 'position': 'right', 'size': 10, 'filetype': 'tagbar', 'order': 1 },
  \ }

@zhamlin
Copy link
Owner

zhamlin commented Feb 7, 2019

What order are you creating the windows in so I can try to reproduce? I started with a terminal window, opened up nerd tree, and it went to the correct location.

Your config looks fine to me. Does calling tiler#reorder() after NerdTree is in the wrong spot do anything?

@bag-man
Copy link

bag-man commented Feb 7, 2019

After some investigation it appears to not be configuration based, I think you just aren't accounting for terminal buffers or something of that nature.

Open vim, run :NERDTreeToggle, then move focus back to your main buffer. Then run :term, and you should get a terminal in a new window, horizontally split. Then hit <C-w>N to exit terminal mode, then :call tiler#reorder(), to reorder the windows. Then you end up in the weird state I mentioned.

Let me know if you can't reproduce or need more info!

@zhamlin

@zhamlin
Copy link
Owner

zhamlin commented Feb 11, 2019

I can reproduce it, but at the moment don't have anytime to look into it.
If you decide to try and fix it and need any help feel free to ask.

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

No branches or pull requests

3 participants