Skip to content

Commit

Permalink
Updated visual selection handling
Browse files Browse the repository at this point in the history
  • Loading branch information
romainl committed Aug 25, 2015
1 parent efb9dbb commit 0253182
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions plugin/qlist.vim
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ function! s:Qlist(command, selection, start_at_cursor, ...)
if a:0 > 0 && len(a:1) > 0
let search_pattern = a:1
else
let old_reg = @v
let old_reg = getreg("v")
normal! gv"vy
let search_pattern = substitute(escape(@v, '\/.*$^~[]'), '\\n', '\\n', 'g')
let @v = old_reg
let raw_search = getreg("v")
let search_pattern = substitute(escape(raw_search, '\/.*$^~[]'), '\\n', '\\n', 'g')
call setreg("v", old_reg)
endif
redir => output
silent! execute (a:start_at_cursor ? '+,$' : '') . excmd . ' /' . search_pattern
Expand Down

0 comments on commit 0253182

Please sign in to comment.