It may be distracting the grep workflow. But how about building jobs ? It is completely different from grep: 1. the output of building jobs contains not only error location, but also building progress (which file is being compiled now). 2. The most important output for a building job is the last 1 or 3 lines, which indicate the building result: success or failed . 3. the output of building jobs contains warnings too, which I can simply ignore .
So, people always care about the building result at first, if building job succeeded, there is no need to rewind the output text to the head. That's the main difference from grep to build, especially async build. People care about building progress too, they just need to read the latest output of gnumake, and get known how many files are there to be compiled. In this circumstance, there is also no need to rewind the quickfix window. Getting the job output autoscroll is a basic feature for many editors, just like: - Gedit's output window has autoscroll feature. - EditPlus/UltraEdit/NotePad++'s output window has autoscroll feature. - Eclipse/Visual Studio's output window has autoscroll feature. ................. It is better to provide user an option to get quickfix autoscroll rather than force them using quickfix as an old synchronizing location and force them treating the complex building jobs as a simply grep . skywind3...@163.com From: Yegappan Lakshmanan Date: 2016-06-07 23:28 To: vim_dev Subject: Re: Re: Any way to scroll quickfix window automatically for long-time-running jobs ? Hi, On Mon, Jun 6, 2016 at 10:15 PM, skywind3...@163.com <skywind3...@163.com> wrote: > You mean 'G' command ? > > I write a single script to get quickfix autoscroll, problem seems have been > solved > by 'normal G' with 'windo'.but the cursor seems a little strange: > 1. blinks in a strange frequency: sometimes fast and sometimes slow > 2. 'moving cursor to quickfix window and back' is noticeable, especially in > gvim > 3. sometimes cursor moves to ex-command area and stays 1 second and returns > to the previous window > > version: 7.4.1902 > > quickfix_autoscroll.vim > -------------- > " scroll down > function! Quickfix_Scroll() > if getbufvar('%', '&buftype') == 'quickfix' > normal G > endif > endfunc > > " find quickfix window and scroll to the bottom then return last window > function! Quickfix_AutoScroll() > let l:winnr = winnr() > windo call Quickfix_Scroll() > exec ''.l:winnr.'wincmd w' > endfunc > > " timer callback: simulate a long-time-running job > function! Callback(id) > if !exists('s:index') > let s:index = 0 > else > let s:index = s:index + 1 > endif > caddexpr "output ".s:index > call Quickfix_AutoScroll() > endfunc > > let s:index = 0 > let s:id = timer_start(1000, 'Callback', {'repeat':30}) > > cexpr "" > copen 5 > wincmd k > -------------------- > > Quickfix seems to be designed for the old synchronizing usage (make/grep) > > But after job/channel have been implemented, quickfix should be widely used > to display realtime output of the background process . > You can use a normal buffer to redirect the output from the background process instead of using quickfix. Depending on the user/use-case, it may not be preferable to scroll the quickfix window when a new entry is added to the quickfix list. For example, let us say the redirected output is from grep (that takes a long time to complete). The user is browsing through the matches while grep is adding to the quickfix list in the background. If the quickfix window is scrolled every time a new entry is added, then it will be distracting the browsing work flow. - Yegappan > > When background process takes a long time (eg. rebuilding vim source code), > autoscroll > enables me to watch the building progress and the output while I am editing > / navigating the source files > just like what I do in visual studio. > > Auto scroll can be simulated by using the script above, but is this a > appropriate way ? (cursor problem, etc) > Is it possible to do this in a more graceful/easier method ? > > ________________________________ > skywind3...@163.com > > > From: Bram Moolenaar > Date: 2016-06-07 03:38 > To: skywind3...@163.com > CC: vim-dev > Subject: Re: Any way to scroll quickfix window automatically for > long-time-running jobs ? > > skywind wrote: > >> Since redirecting the job output to quickfix, I need quickfix window >> can scroll to the last line when a new text line added to quickfix. >> >> So I can always see the latest output of a long time running job in >> realtime. >> >> Previously I used `clast` after `caddexpr` in the job callback to >> scroll quickfix but it alway open the last error in the new tab. >> >> Is there a way I can just only scroll quickfix without open the last error >> ? > > You can use > :copen > $ > {jump back to original window} > > Note that recent changes were made to avoid updating the screen each > time, because it was slow. These commands will make it slow again. > You could use a timer to postpone the scrolling or only update once in > so many times. > -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.