Giter Site home page Giter Site logo

quickr-preview.vim's Introduction

Ronak's github stats

quickr-preview.vim's People

Contributors

bengolds avatar jasha10 avatar joeytwiddle avatar konfekt avatar matt1003 avatar rogandhi avatar ronakg 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  avatar

Watchers

 avatar  avatar  avatar  avatar

quickr-preview.vim's Issues

Previewed files are readonly when opened

Steps to reproduce:

  1. Get a QuickFix window with a few files in it (e.g. using :grep)
  2. Hit <Enter> on a file and notice that it opens with readonly unset.
  3. But hit p one or more times on a file and then hit <Enter>. That file will open with readonly set.
  4. (You can test that with :verb set readonly?)

A) I suppose one solution would be:

  1. When we set the buffer values on a preview window, store the pre-existing values in some namespaced buffer variables.
  2. When we close that buffer, or open that buffer for editing, we can restore the original values from those variables.

B) Alternative solution: Completely :bwipeout the buffer before opening it for editing. Then it should open with fresh settings.
(Of course we don't want to do that if the buffer was already open before we started previewing.)

Error in function QFList when calling

My vim setting:
set completeopt=menuone,popup,longest
set previewpopup=height:10,width:60

According to #23 I also set
like let g:quickr_preview_position = 'popup'

Here my error (true in german .., sorry :( ) output when calling \leader space.
|| Fehler beim Ausführen von "function QFList":
|| Zeile 32:
|| E441: Es gibt kein Vorschaufenster
|| Zeile 44:
|| E366: Popup-Fenster zu betreten nicht erlaubt

No such variable: "b:quickr_preview_timer"

This error is observable when using vim dispatch. When dispatching commands which don't search such as :Make lint the following error is raised:

Error detected while processing function InvokeQFList:
line    1:
E108: No such variable: "b:quickr_preview_timer"

autocmd BufDelete error

while search simbol with quickr_cscope, the quickr_preview whill show the messege as flowings:

"[Quickfix List]" line 1 of 5 --20%-- col 1
Error detected while processing BufDelete Autocommands for "<buffer=5>":
E788: Not allowed to edit another buffer now
Press ENTER or type command to continue

And then, I could noly select the first items in quickr_preview

system: Ubuntu 16.04.6 LTS \n \l
vim: compile with newest vim code(v8.1)

highlight is not work in preview window in macvim.

Except action:
quickr-preview.vim will visual select the whole line in preview window.

But in macvim, this is not work.

screenshot:

In terminal:

2017-10-15 10 55 54

In macvim

2017-10-15 10 57 38

macvim version:

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Oct 5 2017 04:42:50)
MacOS X (unix) version
Included patches: 1-1175
Compiled by [email protected]
Huge version with MacVim GUI. Features included (+) or not (-):
+acl +comments +extra_search +jumplist +mouseshape +odbeditor +scrollbind +termresponse +wildmenu
+arabic +conceal +farsi +keymap +mouse_dec +packages +signs +textobjects +windows
+autocmd +cryptv +file_in_path +lambda -mouse_gpm +path_extra +smartindent +timers +writebackup
+balloon_eval +cscope +find_in_path +langmap -mouse_jsbterm +perl/dyn +startuptime +title -X11
+browse +cursorbind +float +libcall +mouse_netterm +persistent_undo +statusline +toolbar -xfontset
++builtin_terms +cursorshape +folding +linebreak +mouse_sgr +postscript -sun_workshop +transparency +xim
+byte_offset +dialog_con_gui -footer +lispindent -mouse_sysmouse +printer +syntax +user_commands -xpm
+channel +diff +fork() +listcmds +mouse_urxvt +profile +tag_binary +vertsplit -xsmp
+cindent +digraphs +fullscreen +localmap +mouse_xterm +python/dyn +tag_old_static +virtualedit -xterm_clipboard
+clientserver +dnd -gettext +lua/dyn +multi_byte +python3/dyn -tag_any_white +visual -xterm_save
+clipboard -ebcdic -hangul_input +menu +multi_lang +quickfix -tcl +visualextra
+cmdline_compl +emacs_tags +iconv +mksession -mzscheme +reltime +termguicolors +viminfo
+cmdline_hist +eval +insert_expand +modify_fname +netbeans_intg +rightleft +terminal +vreplace
+cmdline_info +ex_extra +job +mouse +num64 +ruby/dyn +terminfo +wildignore
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "/.vim/vimrc"
user exrc file: "$HOME/.exrc"
system gvimrc file: "$VIM/gvimrc"
user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "
/.vim/gvimrc"
defaults file: "$VIMRUNTIME/defaults.vim"
system menu file: "$VIMRUNTIME/menu.vim"
fall-back for $VIM: "/Applications/MacVim.app/Contents/Resources/vim"
Compilation:
clang -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe -DMACOS_X_UNIX -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: clang -L. -fstack-protector -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L. -fstack-protector -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L/usr/local/lib -o Vim -framework Cocoa -framework Carbon -lm -lncurses -liconv -framework Cocoa -fstack-protector -L/System/Library/Perl/5.16/darwin-thread-multi-2level/CORE

Conflicted with quickfix-reflector plugin

I installed both https://github.com/stefandtw/quickfix-reflector.vim and https://github.com/ronakg/quickr-preview.vim plugins, I found when I grep and open quickfix window, I will get the following messages:

2019-02-07 8 23 45

I have no idea what's going on. The only way to get rid of the error messages is to comment the following line:

" autocmd BufDelete <buffer> pclose

And change the close qf mapping to

nnoremap <silent> <plug>(quickr_preview_qf_close) :cclose<CR>:lclose<CR>:pclose<CR>

if you could spare some time to investigate this issue, that will be great.

Thanks.

Highlighting persists after closing preview window

The current line lighting persists when closing the preview window. This is not usually an issue, unless the same buffer exists in another window; in that case highlighting remains in the other window.

Incompatibility with `wrap` option

If the lines displayed in the quick fix window are too long and wrap option is set, quickr-preview does not show the right line in the preview window. A simple workaround is:

autocmd FileType qf set nowrap

Make use of previewpopup of vim

upgrade vim from source, then

:help previewpopup
diff --git a/after/ftplugin/qf.vim b/after/ftplugin/qf.vim
index ac50894..2b45540 100644
--- a/after/ftplugin/qf.vim
+++ b/after/ftplugin/qf.vim
@@ -14,6 +14,7 @@ function! OpenPreviewWindow(bufname, linenr)
                \ (g:quickr_preview_position =~? '\(left\|right\)') ? winwidth(0)/2 :
                \ (&lines-winheight(0))/2
     let l:orig_preview_height = &previewheight
+
     execute 'set previewheight='.l:size
     execute 'keepjumps '.g:quickr_preview_pedit_cmd.' +'.a:linenr.' '.a:bufname
     execute 'set previewheight='.l:orig_preview_height
@@ -172,6 +173,7 @@ endif
 "
 function! QFList(linenr)
     " Get the current entry and ensure it is valid
+    execute 'setlocal previewpopup=height:10'.',width:'.&columns.',border:off'
     let l:entry = GetValidEntry(a:linenr)
     if empty(l:entry)
         return
@@ -187,13 +189,13 @@ function! QFList(linenr)
     if GetPreviewWindow() && l:entry.bufnr == b:prvbufnr
         " Go to preview window
         set eventignore+=all
-        keepjumps wincmd P
+        "keepjumps wincmd P
         " Jump to the line of interest
         execute 'keepjumps '.l:entry.lnum.' | normal! zz'
         " Highlight the line of interest
         execute 'match '.g:quickr_preview_line_hl.' /\%'.l:entry.lnum.'l^\s*\zs.\{-}\ze\s*$/'
         " Go back to qf/loc window
-        keepjumps wincmd p
+        "keepjumps wincmd p
         set eventignore-=all
     else
         " Note if the buffer of interest is already listed
@@ -202,7 +204,7 @@ function! QFList(linenr)
         call OpenPreviewWindow(bufname(l:entry.bufnr), l:entry.lnum)
         " Go to preview window
         set eventignore+=all
-        keepjumps wincmd P
+        "keepjumps wincmd P
         " Settings for preview window
         execute 'setlocal '.g:quickr_preview_options
         " Setting for unlisted buffers
@@ -214,7 +216,7 @@ function! QFList(linenr)
         " Highlight the line of interest
         execute 'match '.g:quickr_preview_line_hl.' /\%'.l:entry.lnum.'l^\s*\zs.\{-}\ze\s*$/'
         " Go back to qf/loc window
-        keepjumps wincmd p
+        "keepjumps wincmd p
         set eventignore-=all
     endif
     let b:prvbufnr = l:entry.bufnr

Auto Close Preview on Quickfix List Close

I've got let g:quickr_preview_on_cursor = 1 set to open the preview automatically.
Naturally, is reverse possible?

Meaning is there a means to also have the preview automatically close on Quickfix List close instead of keeping an un-modifiable preview to stay open?

preview is not scrolling to the concerned line in the file

vim --version:

VIM - Vi IMproved 8.2 (2019 Dec 12, compilé Jan 08 2021 14:00:27)
Rustines incluses : 1-2311

config used:

let g:quickr_preview_keymaps = 0
let g:quickr_preview_position = 'above'
let g:quickr_preview_on_cursor = 1
let g:quickr_preview_exit_on_enter = 1

When I use :ltag <tagname> followed by :lopen, the preview always shown the begining of the file, but if press enter on a result, It jumps to the good line in the file.
I'm not sure my explanation is really clear, so feel free to ask if more clarity is needed.
Regards

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.