Skip to content
Snippets Groups Projects
Commit ed36a0f7 authored by Jerome Reybert's avatar Jerome Reybert
Browse files

Revert "plugin/magit.vim: simplify auto jump to magit window if any"

This reverts commit f5756b24.

ref #119
it is not really related to location window, actually, it does not work
as excpected: window numbers are not consistent:
- winnr() == 1
- vsplit, jump to new window
- winnr() == 1
- last window, winnr() == 2
- close winnr()==1, remaing window winnr()==1
parent 5ce98cda
No related branches found
No related tags found
No related merge requests found
......@@ -667,7 +667,6 @@ function! magit#toggle_help()
call magit#update_buffer()
endfunction
let g:magit_windows = {}
" magit#show_magit: prepare and show magit buffer
" it also set local mappings to magit buffer
" param[in] display:
......@@ -705,8 +704,7 @@ function! magit#show_magit(display, ...)
let buffer_name=fnameescape('magit://' . git_dir)
let magit_win = has_key(g:magit_windows, buffer_name) ?
\ g:magit_windows[buffer_name] : 0
let magit_win = magit#utils#search_buffer_in_windows(buffer_name)
if ( magit_win != 0 )
silent execute magit_win."wincmd w"
......@@ -726,7 +724,6 @@ function! magit#show_magit(display, ...)
else
throw 'parameter_error'
endif
let g:magit_windows[buffer_name] = winnr()
silent execute "buffer " . buffer_name
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment