Skip to content

Commit

Permalink
fix locate file issues on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ervandew committed Dec 19, 2009
1 parent 1438c7e commit a635379
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/vim/eclim/autoload/eclim/common/locate.vim
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,11 @@ function eclim#common#locate#LocateFileCompletion()
let b:completions = completions
let winnr = winnr()
noautocmd exec bufwinnr(b:results_bufnum) . 'winc w'
set modifiable
1,$delete _
call append(1, display)
1,1delete _
set nomodifiable
exec winnr . 'winc w'

" part of bad hack for gvim on windows
Expand Down Expand Up @@ -225,7 +227,7 @@ function s:LocateFileCompletionInit(action, scope, project, workspace)
let bufnum = bufnr('%')
let winrestcmd = winrestcmd()

topleft 12split \[Locate\ Results\]
topleft 12split [Locate\ Results]
set filetype=locate_results
setlocal nonumber nowrap
setlocal noswapfile nobuflisted
Expand All @@ -234,7 +236,8 @@ function s:LocateFileCompletionInit(action, scope, project, workspace)
let results_bufnum = bufnr('%')

let locate_in = (a:scope == 'project' ? a:project : 'workspace')
exec 'topleft 1split ' . escape('[Locate in ' . locate_in . ']', ' []')
exec 'topleft 1split ' . escape('[Locate in ' . locate_in . ']', ' ')
set modifiable
call setline(1, '> ')
call cursor(1, col('$'))
set filetype=locate_prompt
Expand Down Expand Up @@ -337,7 +340,10 @@ function s:LocateFileSelection(sel)
syntax clear
exec 'syntax match PmenuSel /\%' . sel . 'l.*/'
exec 'call cursor(' . sel . ', 1)'
let save_scrolloff = &scrolloff
let &scrolloff = 5
normal! zt
let &scrolloff = save_scrolloff

exec winnr . 'winc w'

Expand Down Expand Up @@ -387,7 +393,7 @@ function s:LocateFileChangeScope()
doautocmd BufLeave

noautocmd exec bufwinnr(b:results_bufnum) . 'winc w'
silent noautocmd exec '50vnew \[Locate\ Scope\]'
silent noautocmd exec '50vnew [Locate\ Scope]'

let b:locate_bufnr = bufnr
let b:locate_winnr = winnr
Expand Down Expand Up @@ -477,7 +483,7 @@ function s:ChooseScope()
let b:project = project
let b:workspace = workspace != '' ? workspace : b:workspace

exec 'file ' . escape('[Locate in ' . locate_in . ']', ' []')
exec 'file ' . escape('[Locate in ' . locate_in . ']', ' ')

call eclim#common#locate#LocateFileCompletion()
endfunction " }}}
Expand Down

0 comments on commit a635379

Please sign in to comment.