Skip to content

Commit

Permalink
Revert "plugin/magit.vim: simplify auto jump to magit window if any"
Browse files Browse the repository at this point in the history
This reverts commit f5756b2.

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
  • Loading branch information
jreybert committed Feb 24, 2017
1 parent 5ce98cd commit ed36a0f
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions plugin/magit.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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"
Expand All @@ -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

Expand Down

0 comments on commit ed36a0f

Please sign in to comment.