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.0 / 7.0.239 < prev    next >
Encoding:
Internet Message Format  |  2007-04-30  |  3.8 KB

  1. To: vim-dev@vim.org
  2. Subject: patch 7.0.239
  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 7.0.239
  11. Problem:    When using local directories and tab pages ":mksession" uses a
  12.         short file name when it shouldn't.  Window-local options from a
  13.         modeline may be applied to the wrong window. (Teemu Likonen)
  14. Solution:   Add the did_lcd flag, use the full path when it's set.  Don't use
  15.         window-local options from the modeline when using the current
  16.         window for another buffer in ":doautoall".
  17. Files:        src/fileio.c,  src/ex_docmd.c
  18.  
  19.  
  20. *** ../vim-7.0.238/src/fileio.c    Tue Feb 27 16:51:07 2007
  21. --- src/fileio.c    Tue May  1 22:35:34 2007
  22. ***************
  23. *** 8086,8092 ****
  24.   
  25.           /* execute the autocommands for this buffer */
  26.           retval = do_doautocmd(eap->arg, FALSE);
  27. !         do_modelines(0);
  28.   
  29.           /* restore the current window */
  30.           aucmd_restbuf(&aco);
  31. --- 8087,8096 ----
  32.   
  33.           /* execute the autocommands for this buffer */
  34.           retval = do_doautocmd(eap->arg, FALSE);
  35. !         /* Execute the modeline settings, but don't set window-local
  36. !          * options if we are using the current window for another buffer. */
  37. !         do_modelines(aco.save_curwin == NULL ? OPT_NOWIN : 0);
  38.   
  39.           /* restore the current window */
  40.           aucmd_restbuf(&aco);
  41. *** ../vim-7.0.238/src/ex_docmd.c    Tue Mar 27 16:57:54 2007
  42. --- src/ex_docmd.c    Tue Mar 27 16:49:06 2007
  43. ***************
  44. *** 375,380 ****
  45. --- 375,381 ----
  46.   static int    put_view __ARGS((FILE *fd, win_T *wp, int add_edit, unsigned *flagp));
  47.   static void    ex_loadview __ARGS((exarg_T *eap));
  48.   static char_u    *get_view_file __ARGS((int c));
  49. + static int    did_lcd;    /* whether ":lcd" was produced for a session */
  50.   #else
  51.   # define ex_loadview        ex_ni
  52.   #endif
  53. ***************
  54. *** 8573,8578 ****
  55. --- 8574,8581 ----
  56.       }
  57.   
  58.   #ifdef FEAT_SESSION
  59. +     did_lcd = FALSE;
  60.       /* ":mkview" or ":mkview 9": generate file name with 'viewdir' */
  61.       if (eap->cmdidx == CMD_mkview
  62.           && (*eap->arg == NUL
  63. ***************
  64. *** 10327,10332 ****
  65. --- 10330,10336 ----
  66.           || ses_put_fname(fd, wp->w_localdir, flagp) == FAIL
  67.           || put_eol(fd) == FAIL)
  68.           return FAIL;
  69. +     did_lcd = TRUE;
  70.       }
  71.   
  72.       return OK;
  73. ***************
  74. *** 10384,10394 ****
  75.       char_u    *name;
  76.   
  77.       /* Use the short file name if the current directory is known at the time
  78. !      * the session file will be sourced.  Don't do this for ":mkview", we
  79. !      * don't know the current directory. */
  80.       if (buf->b_sfname != NULL
  81.           && flagp == &ssop_flags
  82. !         && (ssop_flags & (SSOP_CURDIR | SSOP_SESDIR)))
  83.       name = buf->b_sfname;
  84.       else
  85.       name = buf->b_ffname;
  86. --- 10388,10401 ----
  87.       char_u    *name;
  88.   
  89.       /* Use the short file name if the current directory is known at the time
  90. !      * the session file will be sourced.
  91. !      * Don't do this for ":mkview", we don't know the current directory.
  92. !      * Don't do this after ":lcd", we don't keep track of what the current
  93. !      * directory is. */
  94.       if (buf->b_sfname != NULL
  95.           && flagp == &ssop_flags
  96. !         && (ssop_flags & (SSOP_CURDIR | SSOP_SESDIR))
  97. !         && !did_lcd)
  98.       name = buf->b_sfname;
  99.       else
  100.       name = buf->b_ffname;
  101. *** ../vim-7.0.238/src/version.c    Tue May  1 22:06:41 2007
  102. --- src/version.c    Tue May  1 23:21:32 2007
  103. ***************
  104. *** 668,669 ****
  105. --- 668,671 ----
  106.   {   /* Add new patch number below this line */
  107. + /**/
  108. +     239,
  109.   /**/
  110.  
  111. -- 
  112. Those who live by the sword get shot by those who don't.
  113.  
  114.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  115. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  116. \\\        download, build and distribute -- http://www.A-A-P.org        ///
  117.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  118.