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

Fix behavior of QFToggle #3

Closed
romainl opened this issue Mar 14, 2016 · 2 comments
Closed

Fix behavior of QFToggle #3

romainl opened this issue Mar 14, 2016 · 2 comments

Comments

@romainl
Copy link
Owner

romainl commented Mar 14, 2016

No description provided.

@ntnn
Copy link
Collaborator

ntnn commented Apr 6, 2016

Started working on this here, based on what I already had.

It works really well, but I'm unhappy with the time ToggleQuickfix needs:

FUNCTIONS SORTED ON TOTAL TIME
count  total (s)   self (s)  function
    4   0.012994   0.000824  qf#ToggleQuickfix()
    2   0.000110   0.000093  sy#start()
    1   0.000074             qf#ToggleLocationList()
    2   0.000072             qf#ReuseTitle()
    2   0.000017             <SNR>45_skip()
                             qf#NextFile()
                             qf#JumpToFirstItemOfFileChunk()
                             qf#SetStatusline()
                             qf#DoList()
                             sy#toggle()
                             qf#PreviousFile()
                             qf#AddTitle()
                             sy#buffer_is_active()
                             sy#disable()
                             qf#JumpFileChunk()
                             sy#enable()
                             qf#SetTitle()
                             qf#FunctionName()
                             qf#AddList()
                             qf#SetList()

But the problem isn't the code - its :cclose and :copen:

FUNCTION  qf#ToggleQuickfix()
Called 4 times
Total time:   0.012994
 Self time:   0.000824

count  total (s)   self (s)
    4              0.000045     if get(t:, 'quickfix_window', 0)
    2              0.000011         if t:quickfix_window == winnr()
                                        " jump back to the previous window if inside the quickfix
                                        " window, otherwise it jumps to the next window in the list
                                        wincmd p
                                    endif
    2   0.000918   0.000280         cclose
    2              0.000007         let t:quickfix_window = 0
    2              0.000002     else
    2   0.011943   0.000410         copen
    2              0.000007         let t:quickfix_window = 1
    2              0.000002     endif

If you could profile it yourself and see if its an actual problem or my
setup, that'd be nice.

@romainl
Copy link
Owner Author

romainl commented Sep 11, 2016

Toggling is now part of vim-qf as of version 0.0.9.

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

No branches or pull requests

2 participants