Giter VIP home page Giter VIP logo

vim-qf-preview's People

Contributors

bfrg avatar hokorobi avatar tsuyoshicho avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

vim-qf-preview's Issues

scrollup/down mapping to <C-Up>/<C-Down> ?

Hi,

Thank you for vim-qf-preview.
If I use:

let g:qfpreview = {
    \ 'top'   : "\<Home>",
    \ 'bottom': "\<End>",
    \ 'scrollup'  : "\<C-k>",
    \ 'scrolldown': "\<C-j>",
    \ 'halfpageup'  : "\<C-b>",
    \ 'halfpagedown': "\<C-f>",
    \ 'fullpageup'  : "\<PageUp>",
    \ 'fullpagedown': "\<PageDown>",
    \ 'next': "\<Down>",
    \ 'previous': "\<Up>",
    \ 'reset': "r",
    \ 'close': "q",
    \ 'number': "1",
    \ 'height': "15",
    \ 'offset': "7",
    \ 'sign': {'linehl': 'CursorLine'},
    \ }

Everything works fine. But if I change the <C-k>/<C-j> to <C-Up>/<C-Down>, as in:

    \ 'scrollup'  : "\<C-Up>",
    \ 'scrolldown': "\<C-Down>",

Then these do not work anymore. I do use <C-Up>/<C-Down> successfully for other things in vim (not in popup)
Do you know if it is possible to make this work ?

thx,
-m

close actions can't be mapped

image
All but close actions can be mapped to certain keys.
I can bind to page down but failed in binding q to close the preview window.
Strangely close is highlighted in my color scheme (one-dark). Maybe it is recognized as a semantic keyword?

Preview popup unexpectedly closed when moving to next or previous quickfix item with 'n' or 'p'

Sometimes the popup window is unexpectedly closed when moving to the next or previous quickfix item with the keys specified in with next and previous options.

It seems to be caused by vim-cool and occurs when n or N are pressed right before the preview popup is opened. It happens only with the following vim-qf-preview settings:

let g:qfpreview = {'previous': 'p', 'next': 'n'}

but not with, for example:

let g:qfpreview = {'previous': "\<c-p>", 'next': "\<c-n>"}

To reproduce

  1. Add the following settings to your vimrc:
    let g:qfpreview = {'previous': 'p', 'next': 'n'}
    
    augroup test
        autocmd!
        autocmd FileType qf nmap <Buffer> p <Plug>(qf-preview-open)
    augroup END
  2. Run vimgrep function $VIMRUNTIME/* or similar command to populate the quickfix list.
  3. Go to the quickfix window and press n or N to repeat the last / or ? pattern. It doesn't matter whether the next occurrence is found.
  4. Without moving the cursor press p to open the popup window.
  5. While the popup window is displayed move to the next or previous quickfix item with n or p, respectively.
  6. Result: vim-qf-preview moves the cursor properly to the next item but the popup window will close.
  7. Repeat step 3., but this time move the cursor with h/j/k/l before opening the popup window.
  8. Result: Moving to the next or previous quickfix item from the popup window works as expected.

Now use different keys for next and previous:

let g:qfpreview = {'previous': "\<c-p>", 'next': "\<c-n>"}

augroup test
    autocmd!
    autocmd FileType qf nmap <Buffer> p <Plug>(qf-preview-open)
augroup END

and repeat the above steps. Everything works as expected.

added mappings ?

Hi,
Thanks for an awesome plugin.
I was wondering about adding:
1). additional mappings for close (ie q, <Esc>, <C-c>, etc.)
2). an auto popup mode where scrolling in qf auto pops the preview
Would you consider such features ? If so I will look into it.
thx,
-m

qfpreview#Open throws error "Using a String as a Number"

Hello,

Since the commit introducing vim9, I systematically get an error when trying to display a preview.

Environment

I'm using gvim_9.0.2081.0 and vim-qf-preview on its latest stable commit on Windows10

Steps to reproduce

  • open autoload/qfpreview.vim
  • :vim open %
  • try to open the first qflist item with vim-qf-preview

Expected behaviour

The preview is displayed

Actual behaviour

An error is thrown:
image

Additional information

The error points to the following line:

const firstline: number = qf_item.lnum - Getopt('offset') < 1 ? 1 : qf_item.lnum - Getopt('offset')

and apparently vim9 does not like the fact that Getopt('offset') returns a String.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.