Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set the list's 'title' with last search string #57

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions autoload/ferret/private/shared.vim
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,20 @@ function! s:autojump()
return l:autojump
endfunction

function! s:settitle(type, title) abort
if has('patch-7.4.2200')
if a:type ==# 'qf'
call setqflist([], 'a', {'title' : a:title})
else
call setloclist(0, [], 'a', {'title' : a:title})
endif
elseif a:type ==# 'qf'
let w:quickfix_title = a:title
endif
endfunction

function! ferret#private#shared#finalize_search(output, ack)
let l:lastsearch = get(g:, 'ferret_lastsearch', '')
let l:original_errorformat=&errorformat
let l:autojump=s:autojump()
if a:ack
Expand All @@ -45,6 +58,7 @@ function! ferret#private#shared#finalize_search(output, ack)
else
call s:swallow(l:prefix . 'getexpr a:1', a:output)
endif
call s:settitle(l:post, 'Search `' . l:lastsearch . '`')
let l:before=winnr()
let l:len=ferret#private#post(l:post)
if l:len
Expand Down
1 change: 1 addition & 0 deletions doc/ferret.txt
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,7 @@ order):
- Daniel Silva
- Filip Szymański
- Joe Lencioni
- Jon Parise
- Nelo-Thara Wallus
- Tom Dooner
- Vaibhav Sagar
Expand Down