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