Loading ...
Sorry, an error occurred while loading the content.

Bug? with setlocal isk-= isk+=

Expand Messages
  • Mark Waggoner
    If you execute the following lines, the iskeyword option will end up containing the comma (,) character. echomsg &iskeyword setlocal isk-= setlocal isk+=
    Message 1 of 3 , Sep 3, 2003
    • 0 Attachment
      If you execute the following lines, the iskeyword option will end up
      containing the comma (,) character.

      echomsg &iskeyword
      setlocal isk-=
      setlocal isk+=
      echomsg &iskeyword
      setlocal isk-=
      setlocal isk+=
      echomsg &iskeyword

      Here's the output I got:

      @,48-57,_
      @,48-57,_,
      @,48-57,_,,

      I discovered this when I installed vimspell.vim, which does this.

      Assuming that "+=" with nothing after it should add the comma and empty
      value, then "-=" should remove it.


      I tried this with vim6.2, patches 1-72 installed.


      --
      Mark Waggoner |
      waggoner@... | Yes we've each got ten toes.
      503-712-3335 | And we've each got one nose.
      dpg-or.pdx.intel.com/~waggoner |
    • Bram Moolenaar
      ... :set isk+= should not add a comma. It might actually give an error message, because this command doesn t make sense. This patch should fix it: ...
      Message 2 of 3 , Sep 4, 2003
      • 0 Attachment
        Mark Waggoner wrote:

        > If you execute the following lines, the iskeyword option will end up
        > containing the comma (,) character.
        >
        > echomsg &iskeyword
        > setlocal isk-=
        > setlocal isk+=
        > echomsg &iskeyword
        > setlocal isk-=
        > setlocal isk+=
        > echomsg &iskeyword
        >
        > Here's the output I got:
        >
        > @,48-57,_
        > @,48-57,_,
        > @,48-57,_,,
        >
        > I discovered this when I installed vimspell.vim, which does this.
        >
        > Assuming that "+=" with nothing after it should add the comma and empty
        > value, then "-=" should remove it.

        ":set isk+=" should not add a comma. It might actually give an error
        message, because this command doesn't make sense.

        This patch should fix it:

        *** ../vim-6.2.072/src/option.c Mon Jun 2 22:01:43 2003
        --- src/option.c Thu Sep 4 21:09:02 2003
        ***************
        *** 3818,3824 ****
        * needed */
        if (adding || prepending)
        {
        ! comma = ((flags & P_COMMA) && *origval);
        if (adding)
        {
        i = (int)STRLEN(origval);
        --- 3818,3825 ----
        * needed */
        if (adding || prepending)
        {
        ! comma = ((flags & P_COMMA) && *origval != NUL
        ! && *newval != NUL);
        if (adding)
        {
        i = (int)STRLEN(origval);

        --
        CUSTOMER: You're not fooling anyone y'know. Look, isn't there something
        you can do?
        DEAD PERSON: I feel happy... I feel happy.
        [whop]
        CUSTOMER: Ah, thanks very much.
        MORTICIAN: Not at all. See you on Thursday.
        CUSTOMER: Right.
        The Quest for the Holy Grail (Monty Python)

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
        \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
        \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///
      • Mark Waggoner
        ... That does, indeed fix it. Thanks! -- Mark Waggoner | waggoner@ichips.intel.com | After all - A person s a person. 503-712-3335
        Message 3 of 3 , Sep 4, 2003
        • 0 Attachment
          On Thu, 4 Sep 2003, Bram Moolenaar wrote:

          > From: Bram Moolenaar <Bram@...>
          > Date: Thu, 04 Sep 2003 21:16:22 +0200
          > Subject: Re: Bug? with setlocal isk-= isk+=
          >
          >
          > Mark Waggoner wrote:
          >
          > > If you execute the following lines, the iskeyword option will end up
          > > containing the comma (,) character.
          > >
          > > echomsg &iskeyword
          > > setlocal isk-=
          > > setlocal isk+=
          > > echomsg &iskeyword
          > > setlocal isk-=
          > > setlocal isk+=
          > > echomsg &iskeyword
          > >
          > > Here's the output I got:
          > >
          > > @,48-57,_
          > > @,48-57,_,
          > > @,48-57,_,,
          > >
          > > I discovered this when I installed vimspell.vim, which does this.
          > >
          > > Assuming that "+=" with nothing after it should add the comma and empty
          > > value, then "-=" should remove it.
          >
          > ":set isk+=" should not add a comma. It might actually give an error
          > message, because this command doesn't make sense.
          >
          > This patch should fix it:
          >
          > *** ../vim-6.2.072/src/option.c Mon Jun 2 22:01:43 2003
          > --- src/option.c Thu Sep 4 21:09:02 2003
          > ***************
          > *** 3818,3824 ****
          > * needed */
          > if (adding || prepending)
          > {
          > ! comma = ((flags & P_COMMA) && *origval);
          > if (adding)
          > {
          > i = (int)STRLEN(origval);
          > --- 3818,3825 ----
          > * needed */
          > if (adding || prepending)
          > {
          > ! comma = ((flags & P_COMMA) && *origval != NUL
          > ! && *newval != NUL);
          > if (adding)
          > {
          > i = (int)STRLEN(origval);


          That does, indeed fix it. Thanks!

          --
          Mark Waggoner |
          waggoner@... | After all - A person's a person.
          503-712-3335 | No matter how small.
          dpg-or.pdx.intel.com/~waggoner |
        Your message has been successfully submitted and would be delivered to recipients shortly.