home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 7.3 / 7.3.1274 < prev    next >
Encoding:
Internet Message Format  |  2013-06-29  |  3.3 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.3.1274
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 7.3.1274
  11. Problem:    When selecting an entry from a location list it may pick an
  12.         arbitrary window or open a new one.
  13. Solution:   Prefer using a window related to the location list. (Lech Lorens)
  14. Files:        src/quickfix.c
  15.  
  16.  
  17. *** ../vim-7.3.1273/src/quickfix.c    2013-06-30 13:33:53.000000000 +0200
  18. --- src/quickfix.c    2013-06-30 13:48:25.000000000 +0200
  19. ***************
  20. *** 1616,1621 ****
  21. --- 1616,1623 ----
  22.        */
  23.       if (bt_quickfix(curbuf) && !opened_window)
  24.       {
  25. +     win_T *usable_win_ptr = NULL;
  26.       /*
  27.        * If there is no file specified, we don't know where to go.
  28.        * But do advance, otherwise ":cn" gets stuck.
  29. ***************
  30. *** 1623,1636 ****
  31.       if (qf_ptr->qf_fnum == 0)
  32.           goto theend;
  33.   
  34. -     /* Locate a window showing a normal buffer */
  35.       usable_win = 0;
  36. !     FOR_ALL_WINDOWS(win)
  37. !         if (win->w_buffer->b_p_bt[0] == NUL)
  38. !         {
  39. !         usable_win = 1;
  40. !         break;
  41. !         }
  42.   
  43.       /*
  44.        * If no usable window is found and 'switchbuf' contains "usetab"
  45. --- 1625,1653 ----
  46.       if (qf_ptr->qf_fnum == 0)
  47.           goto theend;
  48.   
  49.       usable_win = 0;
  50. !     ll_ref = curwin->w_llist_ref;
  51. !     if (ll_ref != NULL)
  52. !     {
  53. !         /* Find a window using the same location list that is not a
  54. !          * quickfix window. */
  55. !         FOR_ALL_WINDOWS(usable_win_ptr)
  56. !         if (usable_win_ptr->w_llist == ll_ref
  57. !             && usable_win_ptr->w_buffer->b_p_bt[0] != 'q')
  58. !             break;
  59. !     }
  60. !     if (!usable_win)
  61. !     {
  62. !         /* Locate a window showing a normal buffer */
  63. !         FOR_ALL_WINDOWS(win)
  64. !         if (win->w_buffer->b_p_bt[0] == NUL)
  65. !         {
  66. !             usable_win = 1;
  67. !             break;
  68. !         }
  69. !     }
  70.   
  71.       /*
  72.        * If no usable window is found and 'switchbuf' contains "usetab"
  73. ***************
  74. *** 1659,1666 ****
  75.        */
  76.       if (((firstwin == lastwin) && bt_quickfix(curbuf)) || !usable_win)
  77.       {
  78. -         ll_ref = curwin->w_llist_ref;
  79.           flags = WSP_ABOVE;
  80.           if (ll_ref != NULL)
  81.           flags |= WSP_NEWLOC;
  82. --- 1676,1681 ----
  83. ***************
  84. *** 1683,1694 ****
  85.           if (curwin->w_llist_ref != NULL)
  86.           {
  87.           /* In a location window */
  88. !         ll_ref = curwin->w_llist_ref;
  89. !         /* Find the window with the same location list */
  90. !         FOR_ALL_WINDOWS(win)
  91. !             if (win->w_llist == ll_ref)
  92. !             break;
  93.           if (win == NULL)
  94.           {
  95.               /* Find the window showing the selected file */
  96. --- 1698,1704 ----
  97.           if (curwin->w_llist_ref != NULL)
  98.           {
  99.           /* In a location window */
  100. !         win = usable_win_ptr;
  101.           if (win == NULL)
  102.           {
  103.               /* Find the window showing the selected file */
  104. *** ../vim-7.3.1273/src/version.c    2013-06-30 13:33:53.000000000 +0200
  105. --- src/version.c    2013-06-30 13:56:35.000000000 +0200
  106. ***************
  107. *** 730,731 ****
  108. --- 730,733 ----
  109.   {   /* Add new patch number below this line */
  110. + /**/
  111. +     1274,
  112.   /**/
  113.  
  114. -- 
  115. Witches prefer brooms: vacuum-cleaners need extension cords!
  116.  
  117.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  118. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  119. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  120.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  121.