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.4 / 7.4.311 < prev    next >
Encoding:
Internet Message Format  |  2014-05-27  |  4.6 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.4.311
  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.4.311
  11. Problem:    Can't use winrestview to only restore part of the view.
  12. Solution:   Handle missing items in the dict. (Christian Brabandt)
  13. Files:        src/eval.c, runtime/doc/eval.txt
  14.  
  15.  
  16. *** ../vim-7.4.310/src/eval.c    2014-05-28 14:32:47.156104334 +0200
  17. --- src/eval.c    2014-05-28 16:42:25.196172421 +0200
  18. ***************
  19. *** 19231,19250 ****
  20.       EMSG(_(e_invarg));
  21.       else
  22.       {
  23. !     curwin->w_cursor.lnum = get_dict_number(dict, (char_u *)"lnum");
  24. !     curwin->w_cursor.col = get_dict_number(dict, (char_u *)"col");
  25.   #ifdef FEAT_VIRTUALEDIT
  26. !     curwin->w_cursor.coladd = get_dict_number(dict, (char_u *)"coladd");
  27.   #endif
  28. !     curwin->w_curswant = get_dict_number(dict, (char_u *)"curswant");
  29. !     curwin->w_set_curswant = FALSE;
  30.   
  31. !     set_topline(curwin, get_dict_number(dict, (char_u *)"topline"));
  32.   #ifdef FEAT_DIFF
  33. !     curwin->w_topfill = get_dict_number(dict, (char_u *)"topfill");
  34.   #endif
  35. !     curwin->w_leftcol = get_dict_number(dict, (char_u *)"leftcol");
  36. !     curwin->w_skipcol = get_dict_number(dict, (char_u *)"skipcol");
  37.   
  38.       check_cursor();
  39.       win_new_height(curwin, curwin->w_height);
  40. --- 19231,19260 ----
  41.       EMSG(_(e_invarg));
  42.       else
  43.       {
  44. !     if (dict_find(dict, (char_u *)"lnum", -1) != NULL)
  45. !         curwin->w_cursor.lnum = get_dict_number(dict, (char_u *)"lnum");
  46. !     if (dict_find(dict, (char_u *)"col", -1) != NULL)
  47. !         curwin->w_cursor.col = get_dict_number(dict, (char_u *)"col");
  48.   #ifdef FEAT_VIRTUALEDIT
  49. !     if (dict_find(dict, (char_u *)"coladd", -1) != NULL)
  50. !         curwin->w_cursor.coladd = get_dict_number(dict, (char_u *)"coladd");
  51.   #endif
  52. !     if (dict_find(dict, (char_u *)"curswant", -1) != NULL)
  53. !     {
  54. !         curwin->w_curswant = get_dict_number(dict, (char_u *)"curswant");
  55. !         curwin->w_set_curswant = FALSE;
  56. !     }
  57.   
  58. !     if (dict_find(dict, (char_u *)"topline", -1) != NULL)
  59. !         set_topline(curwin, get_dict_number(dict, (char_u *)"topline"));
  60.   #ifdef FEAT_DIFF
  61. !     if (dict_find(dict, (char_u *)"topfill", -1) != NULL)
  62. !         curwin->w_topfill = get_dict_number(dict, (char_u *)"topfill");
  63.   #endif
  64. !     if (dict_find(dict, (char_u *)"leftcol", -1) != NULL)
  65. !         curwin->w_leftcol = get_dict_number(dict, (char_u *)"leftcol");
  66. !     if (dict_find(dict, (char_u *)"skipcol", -1) != NULL)
  67. !         curwin->w_skipcol = get_dict_number(dict, (char_u *)"skipcol");
  68.   
  69.       check_cursor();
  70.       win_new_height(curwin, curwin->w_height);
  71. *** ../vim-7.4.310/runtime/doc/eval.txt    2014-05-28 14:32:47.164104334 +0200
  72. --- runtime/doc/eval.txt    2014-05-28 16:42:25.192172421 +0200
  73. ***************
  74. *** 6404,6409 ****
  75. --- 6414,6429 ----
  76.   winrestview({dict})
  77.           Uses the |Dictionary| returned by |winsaveview()| to restore
  78.           the view of the current window.
  79. +         Note: The {dict} does not have to contain all values, that are
  80. +         returned by |winsaveview()|. If values are missing, those
  81. +         settings won't be restored. So you can use: >
  82. +             :call winrestview({'curswant': 4})
  83. + <
  84. +         This will only set the curswant value (the column the cursor
  85. +         wants to move on vertical movements) of the cursor to column 5
  86. +         (yes, that is 5), while all other settings will remain the
  87. +         same. This is useful, if you set the cursor position manually.
  88.           If you have changed the values the result is unpredictable.
  89.           If the window size changed the result won't be the same.
  90.   
  91. ***************
  92. *** 6418,6424 ****
  93.           not opened when moving around.
  94.           The return value includes:
  95.               lnum        cursor line number
  96. !             col        cursor column
  97.               coladd        cursor column offset for 'virtualedit'
  98.               curswant    column for vertical movement
  99.               topline        first line in the window
  100. --- 6438,6446 ----
  101.           not opened when moving around.
  102.           The return value includes:
  103.               lnum        cursor line number
  104. !             col        cursor column (Note: the first column
  105. !                     zero, as opposed to what getpos()
  106. !                     returns)
  107.               coladd        cursor column offset for 'virtualedit'
  108.               curswant    column for vertical movement
  109.               topline        first line in the window
  110. *** ../vim-7.4.310/src/version.c    2014-05-28 14:32:47.164104334 +0200
  111. --- src/version.c    2014-05-28 16:45:19.200173944 +0200
  112. ***************
  113. *** 736,737 ****
  114. --- 736,739 ----
  115.   {   /* Add new patch number below this line */
  116. + /**/
  117. +     311,
  118.   /**/
  119.  
  120. -- 
  121. Your fault: core dumped
  122.  
  123.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  124. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  125. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  126.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  127.