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 / 6.0.216 < prev    next >
Encoding:
Internet Message Format  |  2002-02-10  |  2.6 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.0.216
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.0.216
  11. Problem:    After reloading a file, displayed in another window than the
  12.         current one, which was changed outside of Vim the part of the file
  13.         around the cursor set by autocommands may be displayed, but
  14.         jumping back to the original cursor position when entering the
  15.         window again.
  16. Solution:   Restore the topline of the window.
  17. Files:        src/fileio.c
  18.  
  19.  
  20. *** ../vim60.215/src/fileio.c    Mon Feb 11 14:00:48 2002
  21. --- src/fileio.c    Mon Feb 11 16:46:53 2002
  22. ***************
  23. *** 5174,5179 ****
  24. --- 5182,5188 ----
  25.       linenr_T    old_line_count = buf->b_ml.ml_line_count;
  26.       exarg_T        ea;
  27.       pos_T        old_cursor;
  28. +     linenr_T    old_topline;
  29.       int        old_ro = curbuf->b_p_ro;
  30.   #ifdef FEAT_AUTOCMD
  31.       aco_save_T    aco;
  32. ***************
  33. *** 5193,5198 ****
  34. --- 5202,5208 ----
  35.       if (prep_exarg(&ea, buf) == OK)
  36.       {
  37.           old_cursor = curwin->w_cursor;
  38. +         old_topline = curwin->w_topline;
  39.           if (bufempty())
  40.           old_line_count = 0;
  41.           curbuf->b_flags |= BF_CHECK_RO;    /* check for RO again */
  42. ***************
  43. *** 5214,5223 ****
  44.           }
  45.           vim_free(ea.cmd);
  46.   
  47. !         /* Restore the cursor position and check it (lines may have been
  48. !          * removed). */
  49.           curwin->w_cursor = old_cursor;
  50.           check_cursor();
  51.   #ifdef FEAT_AUTOCMD
  52.           keep_filetype = FALSE;
  53.   #endif
  54. --- 5224,5238 ----
  55.           }
  56.           vim_free(ea.cmd);
  57.   
  58. !         /* Restore the topline and cursor position and check it (lines may
  59. !          * have been removed). */
  60. !         if (old_topline > curbuf->b_ml.ml_line_count)
  61. !         curwin->w_topline = curbuf->b_ml.ml_line_count;
  62. !         else
  63. !         curwin->w_topline = old_topline;
  64.           curwin->w_cursor = old_cursor;
  65.           check_cursor();
  66. +         update_topline();
  67.   #ifdef FEAT_AUTOCMD
  68.           keep_filetype = FALSE;
  69.   #endif
  70. *** ../vim60.215/src/version.c    Mon Feb 11 15:45:47 2002
  71. --- src/version.c    Mon Feb 11 16:55:17 2002
  72. ***************
  73. *** 608,609 ****
  74. --- 608,611 ----
  75.   {   /* Add new patch number below this line */
  76. + /**/
  77. +     216,
  78.   /**/
  79.  
  80. -- 
  81. WOMAN:   Dennis, there's some lovely filth down here.  Oh -- how d'you do?
  82. ARTHUR:  How do you do, good lady.  I am Arthur, King of the Britons.
  83.          Who's castle is that?
  84. WOMAN:   King of the who?
  85.                                   The Quest for the Holy Grail (Monty Python)
  86.  
  87.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  88. (((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  89.  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///
  90.