Dominique Pelle wrote:
> > I don't think that skipping white space before the pattern is a problem. > > I would rather call it an improvement. However, I think your solution > > also has the effect that it's not possible to have a space in the > > pattern. That is undesired. > > I found another way to fix it, and preserve old behavior, so that it > allows to search for pattern which contains, start or ends with > space(s). For example ":cs find e a " will successfully match > strings " a " (space, a, space). > > I attach the patch to this email. Patch also contain fixes for > a couple of typos. Hmm, strtok() doesn't make it easy for us. Apparently there is no way to get the pointer of where it currently is looking for the next token without changing the string. Your solution depends on strtok() changing the space after the command to a NUL. What if there are several spaces: ":cs find e a"? I don't think it is defined what strtok() does with the extra spaces. They could be replaced with NUL or not. Another solution, which is not clean either, is to store the length of eap->arg in a global variable, before the first call to strtok(). -- hundred-and-one symptoms of being an internet addict: 196. Your computer costs more than your car. /// Bram Moolenaar -- [EMAIL PROTECTED] -- 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://ICCF-Holland.org /// --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
