Re: Patch 7.4.718

2016-01-22 Fir de Conversatie Bram Moolenaar

Christian Brabandt wrote:

> On Mo, 04 Mai 2015, Bram Moolenaar wrote:
> 
> > Patch 7.4.718
> > Problem:Autocommands triggered by quickfix cannot get the current title
> > value.
> > Solution:   Set w:quickfix_title earlier. (Yannick)
> > Also move the check for a title into the function.
> > Files:  src/quickfix.c
> 
> The same problem occurs in qf_update_buffer() later on as noticed by the 
> neovim guys.
> 
> Attached patch fixes it (and tests for it).

Thanks!


-- 
How To Keep A Healthy Level Of Insanity:
1. At lunch time, sit in your parked car with sunglasses on and point
   a hair dryer at passing cars. See if they slow down.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
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.


Re: Patch 7.4.718

2016-01-22 Fir de Conversatie Christian Brabandt
Hi Bram!

On Mo, 04 Mai 2015, Bram Moolenaar wrote:

> 
> Patch 7.4.718
> Problem:Autocommands triggered by quickfix cannot get the current title
> value.
> Solution:   Set w:quickfix_title earlier. (Yannick)
> Also move the check for a title into the function.
> Files:  src/quickfix.c

The same problem occurs in qf_update_buffer() later on as noticed by the neovim 
guys.

Attached patch fixes it (and tests for it).

Best,
Christian
-- 
"Vis superba formae." Ein schönes Wort von Johannes Secundus.
-- Goethe, Maximen und Reflektionen, Nr. 498

-- 
-- 
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.
commit 58a07ec1567c4045b13b4990dce96026cb334971
Author: Christian Brabandt <c...@256bit.org>
Date:   Fri Jan 22 12:57:11 2016 +0100

set quickfix title earlier

diff --git a/src/quickfix.c b/src/quickfix.c
index 014b93d..da405ed 100644
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -2605,17 +2605,16 @@ qf_update_buffer(qi)
 	/* set curwin/curbuf to buf and save a few things */
 	aucmd_prepbuf(, buf);
 
-	qf_fill_buffer(qi);
-
 	if ((win = qf_find_win(qi)) != NULL)
 	{
 	curwin_save = curwin;
 	curwin = win;
 	qf_set_title_var(qi);
 	curwin = curwin_save;
-
 	}
 
+	qf_fill_buffer(qi);
+
 	/* restore curwin/curbuf and a few other things */
 	aucmd_restbuf();
 
diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim
index a4d0f20..5e68450 100644
--- a/src/testdir/test_quickfix.vim
+++ b/src/testdir/test_quickfix.vim
@@ -302,3 +302,17 @@ function Test_helpgrep()
   cclose
 endfunc
 
+func Test_errortitle()
+  augroup QfBufWinEnter
+au!
+au BufWinEnter * :let g:a=get(w:, 'quickfix_title', 'NONE')
+  augroup END
+  copen
+  let a=[{'lnum': 308, 'bufnr': bufnr(''), 'col': 58, 'valid': 1, 'vcol': 0, 'nr': 0, 'type': '', 'pattern': '', 'text': 'au BufWinEnter * :let g:a=get(w:, ''quickfix_title'', ''NONE'')'}]
+  call setqflist(a)
+  call assert_equal(':setqflist()', g:a)
+  augroup QfBufWinEnter
+au!
+  augroup END
+  augroup! QfBufWinEnter
+endfunc


Patch 7.4.718

2015-05-04 Fir de Conversatie Bram Moolenaar

Patch 7.4.718
Problem:Autocommands triggered by quickfix cannot get the current title
value.
Solution:   Set w:quickfix_title earlier. (Yannick)
Also move the check for a title into the function.
Files:  src/quickfix.c


*** ../vim-7.4.717/src/quickfix.c   2015-03-31 13:33:00.801524871 +0200
--- src/quickfix.c  2015-05-04 11:51:56.583831852 +0200
***
*** 2452,2465 
prevwin = win;
  }
  
  /*
   * Fill the buffer with the quickfix list.
   */
  qf_fill_buffer(qi);
  
- if (qi-qf_lists[qi-qf_curlist].qf_title != NULL)
-   qf_set_title_var(qi);
- 
  curwin-w_cursor.lnum = qi-qf_lists[qi-qf_curlist].qf_index;
  curwin-w_cursor.col = 0;
  check_cursor();
--- 2452,2464 
prevwin = win;
  }
  
+ qf_set_title_var(qi);
+ 
  /*
   * Fill the buffer with the quickfix list.
   */
  qf_fill_buffer(qi);
  
  curwin-w_cursor.lnum = qi-qf_lists[qi-qf_curlist].qf_index;
  curwin-w_cursor.col = 0;
  check_cursor();
***
*** 2608,2615 
  
qf_fill_buffer(qi);
  
!   if (qi-qf_lists[qi-qf_curlist].qf_title != NULL
!(win = qf_find_win(qi)) != NULL)
{
curwin_save = curwin;
curwin = win;
--- 2607,2613 
  
qf_fill_buffer(qi);
  
!   if ((win = qf_find_win(qi)) != NULL)
{
curwin_save = curwin;
curwin = win;
***
*** 2625,2635 
  }
  }
  
  static void
  qf_set_title_var(qi)
  qf_info_T *qi;
  {
! set_internal_string_var((char_u *)w:quickfix_title,
qi-qf_lists[qi-qf_curlist].qf_title);
  }
  
--- 2623,2637 
  }
  }
  
+ /*
+  * Set w:quickfix_title if qi has a title.
+  */
  static void
  qf_set_title_var(qi)
  qf_info_T *qi;
  {
! if (qi-qf_lists[qi-qf_curlist].qf_title != NULL)
!   set_internal_string_var((char_u *)w:quickfix_title,
qi-qf_lists[qi-qf_curlist].qf_title);
  }
  
*** ../vim-7.4.717/src/version.c2015-05-04 11:10:21.543941803 +0200
--- src/version.c   2015-05-04 11:53:05.711053186 +0200
***
*** 743,744 
--- 743,746 
  {   /* Add new patch number below this line */
+ /**/
+ 718,
  /**/

-- 
Don't Panic!
-- The Hitchhiker's Guide to the Galaxy

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
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.