Benji Fisher | 1 Dec 2005 05:31

Re: [PATCH] new flags for the search() function

On Wed, Nov 30, 2005 at 08:29:40PM +0100, Bram Moolenaar wrote:
> 
> Benji Fisher wrote:
> 
> The example looks fine to me.  But I'm not sure if the explanation is
> clear, e.g., what "keyword at the current cursor position" means
> exactly.  Perhaps a few snippets of example text will help.

     OK, I will try another draft at the bottom of this note.

> >      I have updated the patch to add Yet Another Flag:  'c' tells the
> > function (search() or searchpair()) to return the column number of the
> > match instead of the line number.  (Give an error message if combined
> > with 'p' or 'm'.)
> 
> Alternative: add a new function that returns a list with both the line
> and column number.  Otherwise you would need to search twice to get
> both.
> 
> 	:let [lnum, col] = search???()

     That project is too ambitious for me (at least for now).

> > 	rettv->vval.v_number = (flags & S_SUBPAT) ? subpatnum :
> > 	   ((flags & SP_RETCOLUMN) ? 1 + pos.col : pos.lnum);
> > 
> > 	v_number	varnumber_T	int or long (if SIZEOF_INT <= 3)
> > 	pos.lnum	linenr_T	long
> 
> Yes, casts are needed here to avoid a warning message from some
(Continue reading)

Zdenek Sekera | 1 Dec 2005 09:01
Picon
Picon

RE: [PATCH] new flags for the search() function

> From: Benji Fisher [mailto:benji <at> member.AMS.org] 
...
> > > 
> > >      How about an even longer paragraph that illustrates 
> most of the
> > > flags?  (Bram, if you like this explanation and it will 
> save you some
> > > effort, I can make an updated patch.)
> > 
> > I find the example a bit long, takes a bit of reading to understand.
> > And it looks like the action can be done with one command
> > ":%s/foo/bar/ge".  Am I missing something?  I'm sure it is 
> possible to
> > come up with a shorter example that shows the use of the flags.
> 
>      I may not be able to satisfy both of you when it comes to
> documentation!

You are doing all right, Benji!

> My current suggestion includes a shorter, less
> comprehensive, more interesting example:
> 
> 		Example of flags. >
> 		    :echo search('\<if\|\(else\)\|\(endif\)', 'nape')
> <		will search for the keywords "if", "else", and 
> "endif" under
> 		or after the cursor.  Because of the 'p' flag, 
> it returns 1,
> 		2, or 3 depending on which keyword is found, or 0 if the
(Continue reading)

Zdenek Sekera | 1 Dec 2005 09:47
Picon
Picon

RE: [PATCH] new flags for the search() function

> -----Original Message-----
> From: Bram <at> moolenaar.net [mailto:Bram <at> moolenaar.net] 
> Sent: 30 November 2005 20:30
> To: Benji Fisher
> Cc: vim-dev <at> vim.org
> Subject: Re: [PATCH] new flags for the search() function
> 
> 
> Benji Fisher wrote:
> 
> >      I may not be able to satisfy both of you when it comes to
> > documentation!  My current suggestion includes a shorter, less
> > comprehensive, more interesting example:
> 
> The example looks fine to me.  But I'm not sure if the explanation is
> clear, e.g., what "keyword at the current cursor position" means
> exactly.  Perhaps a few snippets of example text will help.
> 

Hmmm, we agree (see my previous email) :-)

> >      I have updated the patch to add Yet Another Flag:  'c' 
> tells the
> > function (search() or searchpair()) to return the column 
> number of the
> > match instead of the line number.  (Give an error message 
> if combined
> > with 'p' or 'm'.)
> 
> Alternative: add a new function that returns a list with both the line
(Continue reading)

Bram Moolenaar | 1 Dec 2005 16:08
Picon

Patch 6.4.004


Patch 6.4.004
Problem:    "go" does not work correctly in combination with 'virtualedit'.
	    (Alojz Motesicky)
Solution:   Reset the "coladd" field.
Files:	    src/memline.c

*** ../vim-6.4.003/src/memline.c	Thu Feb 17 11:02:53 2005
--- src/memline.c	Thu Dec  1 16:07:04 2005
***************
*** 4368,4373 ****
--- 4368,4376 ----
      {
  	curwin->w_cursor.lnum = lnum;
  	curwin->w_cursor.col = (colnr_T)boff;
+ # ifdef FEAT_VIRTUALEDIT
+ 	curwin->w_cursor.coladd = 0;
+ # endif
  	curwin->w_set_curswant = TRUE;
      }
      check_cursor();
*** ../vim-6.4.003/src/version.c	Wed Nov 30 12:38:32 2005
--- src/version.c	Thu Dec  1 16:07:55 2005
***************
*** 643,644 ****
--- 643,646 ----
  {   /* Add new patch number below this line */
+ /**/
+     4,
  /**/
(Continue reading)

Sebastian Menge | 1 Dec 2005 16:31
Picon
Picon

vimplugin on sf.net

Hi

I just want to announce, that I have registered a project at sourceforge
for the vimplugin:

http://sf.net/projects/vimplugin

There, interested ppl can get the sources, file bugs, subscribe to the
devel-list.

For more information, see
http://vimplugin.sf.net

Regards, Sebastian.

Konstantin Rozinov | 1 Dec 2005 19:15

inputsecret() showing cleartext...

Hi folks,

I sent this to vim <at> vim.org but thought that maybe this is a bug, so I'm 
sending it to the developers mailing list too:

I have the following piece of code.  It is activated via autocmd BufWriteCmd:

if (v:version >= 700)
                 let s:passwd = inputsecret("Enter password: ")
                 let s:passwd_confirm = inputsecret("Confirm password: ")
                 if ((s:passwd == s:passwd_confirm) && (s:passwd != ''))
                         do stuff....
                         do stuff....
                         unlet s:passwd
                         unlet s:passwd_confirm
                         ......

When the user issues :w, the password is replaced with *s as it is 
typed.  However, when the user issues a :wq, the password is shown in 
cleartext!  Is this a known bug or am I just misusing the function?

Any ideas would be appreciated.  Thanks!
Konstantin Rozinov

Charles E. Campbell, Jr. | 1 Dec 2005 20:15

netrw and cadaver

Hello!

Occasionally I hear that someone has trouble with netrw's cadaver 
support.  There may well be problems with it, as I've never been able to 
test it.  I have cadaver on my computer, but I need someone to provide 
me with something that cadaver can access.

Any volunteers?  I need an url, login, and password.

Also, has anyone used the dav://host/file url with netrw successfully?

Thank you,
Chip Campbell

Ciaran McCreesh | 4 Dec 2005 02:55
Picon
Favicon

vim7 configure check for tcl

The vim7 configure check for tcl seems to need more backslashes to
avoid dumping bogus extra parts of TCL_DEFS into CFLAGS. I think the
attached patch should do it.

Further details of the errors and a tclConfig.sh that triggers this can
be found at https://bugs.gentoo.org/show_bug.cgi?id=113823 .

--

-- 
Ciaran McCreesh : Gentoo Developer (I can kill you with my brain)
Mail            : ciaranm at gentoo.org
Web             : http://dev.gentoo.org/~ciaranm

Bram Moolenaar | 4 Dec 2005 12:38
Picon

Re: vim7 configure check for tcl


Ciaran McCreesh wrote:

> The vim7 configure check for tcl seems to need more backslashes to
> avoid dumping bogus extra parts of TCL_DEFS into CFLAGS. I think the
> attached patch should do it.
> 
> Further details of the errors and a tclConfig.sh that triggers this can
> be found at https://bugs.gentoo.org/show_bug.cgi?id=3D113823 .

Can you explain why there need to be four backslashes to match with one?
There are two to match one backslash, that's the normal way to use a
pattern.

--

-- 
Back up my hard drive?  I can't find the reverse switch!

 /// Bram Moolenaar -- Bram <at> Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://www.ICCF.nl         ///

Ciaran McCreesh | 4 Dec 2005 18:17
Picon
Favicon

Re: vim7 configure check for tcl

On Sun, 04 Dec 2005 12:38:39 +0100 Bram Moolenaar <Bram <at> moolenaar.net>
wrote:
| Ciaran McCreesh wrote:
| > The vim7 configure check for tcl seems to need more backslashes to
| > avoid dumping bogus extra parts of TCL_DEFS into CFLAGS. I think the
| > attached patch should do it.
| > 
| > Further details of the errors and a tclConfig.sh that triggers this
| > can be found at https://bugs.gentoo.org/show_bug.cgi?id=3D113823 .
| 
| Can you explain why there need to be four backslashes to match with
| one? There are two to match one backslash, that's the normal way to
| use a pattern.

We're trying to match a backslash followed by a space, which ordinarily
would use '\\ '. However, we're inside `` quotes, so backslashes need
to be doubled up.

--

-- 
Ciaran McCreesh : Gentoo Developer (I can kill you with my brain)
Mail            : ciaranm at gentoo.org
Web             : http://dev.gentoo.org/~ciaranm


Gmane