4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: After using ":lcd" a script doesn't know how to restore the
13 Solution: Add the haslocaldir() function. (Bob Hiestand)
14 Files: runtime/doc/usr_41.txt, runtime/doc/eval.txt, src/eval.c
17 *** ../vim-7.0.229/runtime/doc/usr_41.txt Sun May 7 17:02:39 2006
18 --- runtime/doc/usr_41.txt Thu Apr 26 17:06:48 2007
21 ! *usr_41.txt* For Vim version 7.0. Last change: 2006 Apr 30
23 VIM USER MANUAL - by Bram Moolenaar
26 ! *usr_41.txt* For Vim version 7.0. Last change: 2007 Apr 26
28 VIM USER MANUAL - by Bram Moolenaar
33 isdirectory() check if a directory exists
34 getfsize() get the size of a file
35 getcwd() get the current working directory
36 + haslocaldir() check if current window used |:lcd|
37 tempname() get the name of a temporary file
38 mkdir() create a new directory
39 delete() delete a file
40 *** ../vim-7.0.229/runtime/doc/eval.txt Tue Mar 27 10:20:58 2007
41 --- runtime/doc/eval.txt Tue Apr 24 21:50:49 2007
44 ! *eval.txt* For Vim version 7.0. Last change: 2006 Nov 01
47 VIM REFERENCE MANUAL by Bram Moolenaar
49 ! *eval.txt* For Vim version 7.0. Last change: 2007 Apr 24
52 VIM REFERENCE MANUAL by Bram Moolenaar
56 globpath( {path}, {expr}) String do glob({expr}) for all dirs in {path}
57 has( {feature}) Number TRUE if feature {feature} supported
58 has_key( {dict}, {key}) Number TRUE if {dict} has entry {key}
59 + haslocaldir() Number TRUE if current window executed |:lcd|
60 hasmapto( {what} [, {mode} [, {abbr}]])
61 Number TRUE if mapping to {what} exists
62 histadd( {history},{item}) String add an item to a history
66 The result is a Number, which is 1 if |Dictionary| {dict} has
67 an entry with key {key}. Zero otherwise.
69 + haslocaldir() *haslocaldir()*
70 + The result is a Number, which is 1 when the current
71 + window has set a local path via |:lcd|, and 0 otherwise.
73 hasmapto({what} [, {mode} [, {abbr}]]) *hasmapto()*
74 The result is a Number, which is 1 if there is a mapping that
75 *** ../vim-7.0.229/src/eval.c Thu Apr 26 10:55:46 2007
76 --- src/eval.c Thu Apr 26 10:52:09 2007
80 static void f_globpath __ARGS((typval_T *argvars, typval_T *rettv));
81 static void f_has __ARGS((typval_T *argvars, typval_T *rettv));
82 static void f_has_key __ARGS((typval_T *argvars, typval_T *rettv));
83 + static void f_haslocaldir __ARGS((typval_T *argvars, typval_T *rettv));
84 static void f_hasmapto __ARGS((typval_T *argvars, typval_T *rettv));
85 static void f_histadd __ARGS((typval_T *argvars, typval_T *rettv));
86 static void f_histdel __ARGS((typval_T *argvars, typval_T *rettv));
90 {"globpath", 2, 2, f_globpath},
92 {"has_key", 2, 2, f_has_key},
93 + {"haslocaldir", 0, 0, f_haslocaldir},
94 {"hasmapto", 1, 3, f_hasmapto},
95 {"highlightID", 1, 1, f_hlID}, /* obsolete */
96 {"highlight_exists",1, 1, f_hlexists}, /* obsolete */
101 rettv->vval.v_number = dict_find(argvars[0].vval.v_dict,
102 get_tv_string(&argvars[1]), -1) != NULL;
106 + * "haslocaldir()" function
110 + f_haslocaldir(argvars, rettv)
114 + rettv->vval.v_number = (curwin->w_localdir != NULL);
118 *** ../vim-7.0.229/src/version.c Thu Apr 26 16:50:05 2007
119 --- src/version.c Thu Apr 26 17:04:15 2007
123 { /* Add new patch number below this line */
129 hundred-and-one symptoms of being an internet addict:
130 22. You've already visited all the links at Yahoo and you're halfway through
133 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
134 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
135 \\\ download, build and distribute -- http://www.A-A-P.org ///
136 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///