From d940ab1c5a598446e2a3b092ff9bd3faa62389eb Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Fri, 19 Feb 2016 00:28:35 +0900 Subject: [PATCH] Revert "[Lines] Use readfile() if buffer is not yet loaded" This reverts commit 16ffd82a58677db7a27cf6829fdc6287af1b91ca. --- autoload/fzf/vim.vim | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/autoload/fzf/vim.vim b/autoload/fzf/vim.vim index dc036e0..00feaf1 100644 --- a/autoload/fzf/vim.vim +++ b/autoload/fzf/vim.vim @@ -194,14 +194,9 @@ function! fzf#vim#_lines(all) let rest = [] let buf = bufnr('') for b in s:buflisted() - let lines = getbufline(b, 1, "$") - if empty(lines) - let path = fnamemodify(bufname(b), ':p') - let lines = filereadable(path) ? readfile(path) : [] - endif call extend(b == buf ? cur : rest, \ filter( - \ map(lines, + \ map(getbufline(b, 1, "$"), \ '(!a:all && empty(v:val)) ? "" : printf("[%s]\t%s:\t%s", s:blue(b), s:yellow(v:key + 1), v:val)'), \ 'a:all || !empty(v:val)')) endfor @@ -418,7 +413,7 @@ endfunction " query, [[ag options], options] function! fzf#vim#ag(query, ...) let args = copy(a:000) - let ag_opts = len(args) > 1 ? remove(args, 0) : get(g:, 'fzf_ag_options', '') + let ag_opts = len(args) > 1 ? remove(args, 0) : '' return s:fzf(fzf#vim#wrap({ \ 'source': printf('ag --nogroup --column --color %s "%s"', \ ag_opts,