3ef2ca
To: vim_dev@googlegroups.com
3ef2ca
Subject: Patch 7.4.392
3ef2ca
Fcc: outbox
3ef2ca
From: Bram Moolenaar <Bram@moolenaar.net>
3ef2ca
Mime-Version: 1.0
3ef2ca
Content-Type: text/plain; charset=UTF-8
3ef2ca
Content-Transfer-Encoding: 8bit
3ef2ca
------------
3ef2ca
3ef2ca
Patch 7.4.392
3ef2ca
Problem:    Not easy to detect type of command line window.
3ef2ca
Solution:   Add the getcmdwintype() function. (Jacob Niehus)
3ef2ca
Files:	    src/eval.c
3ef2ca
3ef2ca
3ef2ca
*** ../vim-7.4.391/src/eval.c	2014-07-09 17:51:46.075801693 +0200
3ef2ca
--- src/eval.c	2014-08-06 13:35:59.303268990 +0200
3ef2ca
***************
3ef2ca
*** 554,559 ****
3ef2ca
--- 554,560 ----
3ef2ca
  static void f_getcmdline __ARGS((typval_T *argvars, typval_T *rettv));
3ef2ca
  static void f_getcmdpos __ARGS((typval_T *argvars, typval_T *rettv));
3ef2ca
  static void f_getcmdtype __ARGS((typval_T *argvars, typval_T *rettv));
3ef2ca
+ static void f_getcmdwintype __ARGS((typval_T *argvars, typval_T *rettv));
3ef2ca
  static void f_getcwd __ARGS((typval_T *argvars, typval_T *rettv));
3ef2ca
  static void f_getfontname __ARGS((typval_T *argvars, typval_T *rettv));
3ef2ca
  static void f_getfperm __ARGS((typval_T *argvars, typval_T *rettv));
3ef2ca
***************
3ef2ca
*** 7984,7989 ****
3ef2ca
--- 7985,7991 ----
3ef2ca
      {"getcmdline",	0, 0, f_getcmdline},
3ef2ca
      {"getcmdpos",	0, 0, f_getcmdpos},
3ef2ca
      {"getcmdtype",	0, 0, f_getcmdtype},
3ef2ca
+     {"getcmdwintype",	0, 0, f_getcmdwintype},
3ef2ca
      {"getcurpos",	0, 0, f_getcurpos},
3ef2ca
      {"getcwd",		0, 0, f_getcwd},
3ef2ca
      {"getfontname",	0, 1, f_getfontname},
3ef2ca
***************
3ef2ca
*** 11503,11508 ****
3ef2ca
--- 11505,11530 ----
3ef2ca
  }
3ef2ca
  
3ef2ca
  /*
3ef2ca
+  * "getcmdwintype()" function
3ef2ca
+  */
3ef2ca
+     static void
3ef2ca
+ f_getcmdwintype(argvars, rettv)
3ef2ca
+     typval_T	*argvars UNUSED;
3ef2ca
+     typval_T	*rettv;
3ef2ca
+ {
3ef2ca
+     rettv->v_type = VAR_STRING;
3ef2ca
+     rettv->vval.v_string = NULL;
3ef2ca
+ #ifdef FEAT_CMDWIN
3ef2ca
+     rettv->vval.v_string = alloc(2);
3ef2ca
+     if (rettv->vval.v_string != NULL)
3ef2ca
+     {
3ef2ca
+ 	rettv->vval.v_string[0] = cmdwin_type;
3ef2ca
+ 	rettv->vval.v_string[1] = NUL;
3ef2ca
+     }
3ef2ca
+ #endif
3ef2ca
+ }
3ef2ca
+ 
3ef2ca
+ /*
3ef2ca
   * "getcwd()" function
3ef2ca
   */
3ef2ca
      static void
3ef2ca
*** ../vim-7.4.391/src/version.c	2014-08-06 13:20:51.799275513 +0200
3ef2ca
--- src/version.c	2014-08-06 13:34:42.903269539 +0200
3ef2ca
***************
3ef2ca
*** 736,737 ****
3ef2ca
--- 736,739 ----
3ef2ca
  {   /* Add new patch number below this line */
3ef2ca
+ /**/
3ef2ca
+     392,
3ef2ca
  /**/
3ef2ca
3ef2ca
-- 
3ef2ca
I learned the customs and mannerisms of engineers by observing them, much the
3ef2ca
way Jane Goodall learned about the great apes, but without the hassle of
3ef2ca
grooming.
3ef2ca
				(Scott Adams - The Dilbert principle)
3ef2ca
3ef2ca
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
3ef2ca
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
3ef2ca
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
3ef2ca
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///