Permalink
Browse files

bugfix in ToFromAgenda so it goes to proper non-Agenda buffer

  • Loading branch information...
1 parent b6072ce commit 03a725860b7a2eaf4e3e0886fe8de0fef51dc341 @hsitz committed Dec 18, 2011
Showing with 7 additions and 1 deletion.
  1. +7 −1 ftplugin/org.vim
View
@@ -3091,7 +3091,13 @@ function! s:ResultsToAgenda( search_type )
endfunction
function! s:ToFromAgenda()
if bufname('%') == '__Agenda__'
- windo if bufname('%') !~ '__Agenda__\|__Calendar' | return | endif
+ for i in range(1, winnr('$'))
+ exe i . 'wincmd w'
+ if bufname('%') !~ '__Agenda__\|__Calendar'
+ break
+ endif
+ endfor
+ "windo if bufname('%') !~ '__Agenda__\|__Calendar' | let return | endif
elseif bufwinnr('__Agenda__') > 0
exec bufwinnr('__Agenda__') . 'wincmd w'
endif

0 comments on commit 03a7258

Please sign in to comment.