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

Live preview #135

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Live preview #135

wants to merge 2 commits into from

Conversation

jdavis
Copy link

@jdavis jdavis commented Jun 8, 2014

I liked the preview ability but didn't like how it took over my main window. With this change, if you have let g:ackpreview = 2, it will show it in a Preview window instead.

Configurable using the g:ackpreview = 2 instead of g:ackpreview = 1

let fname = pos.bufnr

if type(fname) == type(0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I see you do not need this three ifs, you can do just:

if fname == ''
  return
else
  let fname = bufname(fname)
endif

@kassio
Copy link
Contributor

kassio commented Jul 4, 2014

Sorry about the delay on review it. Thank's for the feature! ❤️

@oluckyman
Copy link

This is great feature! As I understand it prevent your active window from overwriting by the first matched file form quickfix list?

@jdavis
Copy link
Author

jdavis commented Jul 11, 2014

@oluckyman It allows you to view where the match is in a scratch window as opposed to the main window.

@dougjohnston
Copy link

+1 This would be a great feature.

@acornejo
Copy link

+1 this would be great!

@jdavis
Copy link
Author

jdavis commented Jan 16, 2015

Nothin?

execute "nnoremap <buffer> <silent> j j<CR><C-W><C-W>"
execute "nnoremap <buffer> <silent> k k<CR><C-W><C-W>"
elseif g:ackpreview == 2
execute "nnoremap <buffer> <silent> j :call ack#preview()<CR>j"
execute "nnoremap <buffer> <silent> k :call ack#preview()<CR>k"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you were just copying the style above, but there's no need for execute on these four nnoremap lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants