comparison src/ex_cmds.c @ 716:8ae24f338cab v7.0217

updated for version 7.0217
author vimboss
date Tue, 07 Mar 2006 22:38:47 +0000
parents 0f9f4761ad9c
children 2fa8cb05b861
comparison
equal deleted inserted replaced
715:b526e10493b1 716:8ae24f338cab
2960 int oldbuf; /* TRUE if using existing buffer */ 2960 int oldbuf; /* TRUE if using existing buffer */
2961 #ifdef FEAT_AUTOCMD 2961 #ifdef FEAT_AUTOCMD
2962 int auto_buf = FALSE; /* TRUE if autocommands brought us 2962 int auto_buf = FALSE; /* TRUE if autocommands brought us
2963 into the buffer unexpectedly */ 2963 into the buffer unexpectedly */
2964 char_u *new_name = NULL; 2964 char_u *new_name = NULL;
2965 int did_set_swapcommand = FALSE;
2965 #endif 2966 #endif
2966 buf_T *buf; 2967 buf_T *buf;
2967 #if defined(FEAT_AUTOCMD) || defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) 2968 #if defined(FEAT_AUTOCMD) || defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
2968 buf_T *old_curbuf = curbuf; 2969 buf_T *old_curbuf = curbuf;
2969 #endif 2970 #endif
3078 /* 3079 /*
3079 * End Visual mode before switching to another buffer, so the text can be 3080 * End Visual mode before switching to another buffer, so the text can be
3080 * copied into the GUI selection buffer. 3081 * copied into the GUI selection buffer.
3081 */ 3082 */
3082 reset_VIsual(); 3083 reset_VIsual();
3084 #endif
3085
3086 #ifdef FEAT_AUTOCMD
3087 if ((command != NULL || newlnum > (linenr_T)0)
3088 && *get_vim_var_str(VV_SWAPCOMMAND) == NUL)
3089 {
3090 int len;
3091 char_u *p;
3092
3093 /* Set v:swapcommand for the SwapExists autocommands. */
3094 if (command != NULL)
3095 len = STRLEN(command) + 3;
3096 else
3097 len = 30;
3098 p = alloc((unsigned)len);
3099 if (p != NULL)
3100 {
3101 if (command != NULL)
3102 vim_snprintf((char *)p, len, ":%s\r", command);
3103 else
3104 vim_snprintf((char *)p, len, "%ldG", (long)newlnum);
3105 set_vim_var_string(VV_SWAPCOMMAND, p, -1);
3106 did_set_swapcommand = TRUE;
3107 vim_free(p);
3108 }
3109 }
3083 #endif 3110 #endif
3084 3111
3085 /* 3112 /*
3086 * If we are starting to edit another file, open a (new) buffer. 3113 * If we are starting to edit another file, open a (new) buffer.
3087 * Otherwise we re-use the current buffer. 3114 * Otherwise we re-use the current buffer.
3617 # endif 3644 # endif
3618 } 3645 }
3619 #endif 3646 #endif
3620 3647
3621 theend: 3648 theend:
3649 #ifdef FEAT_AUTOCMD
3650 if (did_set_swapcommand)
3651 set_vim_var_string(VV_SWAPCOMMAND, NULL, -1);
3652 #endif
3622 #ifdef FEAT_BROWSE 3653 #ifdef FEAT_BROWSE
3623 vim_free(browse_file); 3654 vim_free(browse_file);
3624 #endif 3655 #endif
3625 vim_free(free_fname); 3656 vim_free(free_fname);
3626 return retval; 3657 return retval;