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.1.103 < prev    next >
Encoding:
Internet Message Format  |  2002-06-22  |  3.9 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.1.103
  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.1.103
  11. Problem:    A function returning from a while loop, with 'verbose' set to 12
  12.         or higher, doesn't mention the return value.  A function with the
  13.         'abort' attribute may return -1 while the verbose message says
  14.         something else.
  15. Solution:   Move the verbose message about returning from a function to
  16.         call_func(). (Servatius Brandt)
  17. Files:        src/eval.c
  18.  
  19.  
  20. *** ../vim61.102/src/eval.c    Tue Jun 18 21:33:22 2002
  21. --- src/eval.c    Tue Jun 18 19:32:53 2002
  22. ***************
  23. *** 8241,8246 ****
  24. --- 8247,8277 ----
  25.                        DOCMD_NOWAIT|DOCMD_VERBOSE|DOCMD_REPEAT);
  26.   
  27.       --RedrawingDisabled;
  28. +     /* when the function was aborted because of an error, return -1 */
  29. +     if ((did_emsg && (fp->flags & FC_ABORT)) || retvar->var_type == VAR_UNKNOWN)
  30. +     {
  31. +     clear_var(retvar);
  32. +     retvar->var_type = VAR_NUMBER;
  33. +     retvar->var_val.var_number = -1;
  34. +     }
  35. +     /* when being verbose, mention the return value */
  36. +     if (p_verbose >= 12)
  37. +     {
  38. +     ++no_wait_return;
  39. +     msg_scroll = TRUE;        /* always scroll up, don't overwrite */
  40. +     if (fc.retvar->var_type == VAR_NUMBER)
  41. +         smsg((char_u *)_("%s returning #%ld"), sourcing_name,
  42. +                        (long)fc.retvar->var_val.var_number);
  43. +     else if (fc.retvar->var_type == VAR_STRING)
  44. +         smsg((char_u *)_("%s returning \"%s\""), sourcing_name,
  45. +                          get_var_string(fc.retvar));
  46. +     msg_puts((char_u *)"\n");   /* don't overwrite this either */
  47. +     cmdline_row = msg_row;
  48. +     --no_wait_return;
  49. +     }
  50.       vim_free(sourcing_name);
  51.       sourcing_name = save_sourcing_name;
  52.       sourcing_lnum = save_sourcing_lnum;
  53. ***************
  54. *** 8256,8268 ****
  55.       --no_wait_return;
  56.       }
  57.   
  58. -     /* when the function was aborted because of an error, return -1 */
  59. -     if ((did_emsg && (fp->flags & FC_ABORT)) || retvar->var_type == VAR_UNKNOWN)
  60. -     {
  61. -     clear_var(retvar);
  62. -     retvar->var_type = VAR_NUMBER;
  63. -     retvar->var_val.var_number = -1;
  64. -     }
  65.       did_emsg |= save_did_emsg;
  66.       current_funccal = save_fcp;
  67.   
  68. --- 8287,8292 ----
  69. ***************
  70. *** 8375,8395 ****
  71.       {
  72.       retval = vim_strsave(((char_u **)(gap->ga_data))[fcp->linenr++]);
  73.       sourcing_lnum = fcp->linenr;
  74. -     }
  75. -     if (p_verbose >= 12 && retval == NULL)
  76. -     {
  77. -     ++no_wait_return;
  78. -     msg_scroll = TRUE;        /* always scroll up, don't overwrite */
  79. -     if (fcp->retvar->var_type == VAR_NUMBER)
  80. -         smsg((char_u *)_("%s returning #%ld"), sourcing_name,
  81. -                        (long)fcp->retvar->var_val.var_number);
  82. -     else if (fcp->retvar->var_type == VAR_STRING)
  83. -         smsg((char_u *)_("%s returning \"%s\""), sourcing_name,
  84. -                          get_var_string(fcp->retvar));
  85. -     msg_puts((char_u *)"\n");   /* don't overwrite this either */
  86. -     cmdline_row = msg_row;
  87. -     --no_wait_return;
  88.       }
  89.   
  90.       /* Did we encounter a breakpoint? */
  91. --- 8399,8404 ----
  92. *** ../vim61.102/src/version.c    Sun Jun 23 13:05:10 2002
  93. --- src/version.c    Sun Jun 23 13:07:11 2002
  94. ***************
  95. *** 608,609 ****
  96. --- 608,611 ----
  97.   {   /* Add new patch number below this line */
  98. + /**/
  99. +     103,
  100.   /**/
  101.  
  102. -- 
  103.        When danger reared its ugly head,
  104.        He bravely turned his tail and fled
  105.        Yes, Brave Sir Robin turned about
  106.        And gallantly he chickened out
  107.        Bravely taking to his feet
  108.        He beat a very brave retreat
  109.        Bravest of the brave Sir Robin
  110.        Petrified of being dead
  111.        Soiled his pants then brave Sir Robin
  112.        Turned away and fled.
  113.                  "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
  114.  
  115.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  116. ///   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   \\\
  117. \\\           Project leader for A-A-P -- http://www.a-a-p.org           ///
  118.  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///
  119.