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

:colorscheme bug [patch]

Expand Messages
  • Rafael Garcia-Suarez
    The docs for :colorscheme says that it should set the colors_name variable. ... +++ syntax.c Mon Apr 30 10:31:34 2001 @@ -5853,6 +5853,8 @@ } recursive =
    Message 1 of 4 , Apr 30, 2001
      The docs for :colorscheme says that it should set the colors_name variable.
      It does not. Here's a patch:

      --- syntax.c.orig Sun Apr 29 21:28:25 2001
      +++ syntax.c Mon Apr 30 10:31:34 2001
      @@ -5853,6 +5853,8 @@
      }
      recursive = FALSE;

      + set_internal_string_var((char_u *)"colors_name", p);
      +
      return retval;
      }



      --
      Rafael Garcia-Suarez
    • Bram Moolenaar
      ... Actually, the script is supposed to set the name. You couldn t see that, because I didn t include the example scripts. The advantage of the script
      Message 2 of 4 , Apr 30, 2001
        Rafael Garcia-Suarez wrote:

        > The docs for :colorscheme says that it should set the colors_name variable.
        > It does not. Here's a patch:

        Actually, the script is supposed to set the name. You couldn't see that,
        because I didn't include the example scripts. The advantage of the script
        setting the name is that there can be a slight difference between the file
        name and the actual name of the color scheme (upper/lower case, long file
        name). And you can see in the script what the name is (in case the file got
        renamed).

        --
        A salesperson says: translation:
        "backward compatible" Old technology
        "Premium" Overpriced
        "Can't keep it on the shelf" Unavailable
        "Stands alone" Piece of shit
        "Proprietary" Incompatible
        (Scott Adams - The Dilbert principle)

        /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
        ((( Creator of Vim - http://www.vim.org -- ftp://ftp.vim.org/pub/vim )))
        \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
      • Rafael Garcia-Suarez
        ... [...] Forget this patch. First, it should test if the return value is OK before setting the variable; secondly, the problem with setting a local variable
        Message 3 of 4 , Apr 30, 2001
          On 2001.04.30 10:48:54 +0200 Rafael Garcia-Suarez wrote:
          > The docs for :colorscheme says that it should set the colors_name variable.
          > It does not. Here's a patch:
          [...]

          Forget this patch. First, it should test if the return value is OK before
          setting the variable; secondly, the problem with setting a local variable
          "colors_names" is that it does not work from inside a function. (I'm using
          a function to switch colorschemes depending on options). Sorry...

          A working patch is here :

          --- syntax.c.orig Sun Apr 29 21:28:25 2001
          +++ syntax.c Mon Apr 30 13:41:03 2001
          @@ -5788,7 +5788,7 @@
          * Try finding the color file. Used when a color file was loaded and
          * 'background' or 't_Co' is changed.
          */
          - p = get_var_value((char_u *)"colors_name");
          + p = get_var_value((char_u *)"g:colors_name");
          if (p != NULL && load_colors(p) == OK)
          return;
          #endif
          @@ -5852,6 +5852,10 @@
          vim_free(buf);
          }
          recursive = FALSE;
          +
          + if (retval == OK) {
          + set_internal_string_var((char_u *)"g:colors_name", p);
          + }

          return retval;
          }
        • Thomas Köhler
          On Mon, Apr 30, 2001 at 01:40:54PM +0200, ... So in case the script doesn t set the name, let vim decide the name (for example based on the filename ;-) Best
          Message 4 of 4 , May 1, 2001
            On Mon, Apr 30, 2001 at 01:40:54PM +0200,
            Bram Moolenaar <Bram@...> wrote:
            > Rafael Garcia-Suarez wrote:
            >
            > > The docs for :colorscheme says that it should set the colors_name variable.
            > > It does not. Here's a patch:
            >
            > Actually, the script is supposed to set the name. You couldn't see that,
            > because I didn't include the example scripts. The advantage of the script
            > setting the name is that there can be a slight difference between the file
            > name and the actual name of the color scheme (upper/lower case, long file
            > name). And you can see in the script what the name is (in case the file got
            > renamed).

            So in case the script doesn't set the name, let vim decide the name (for
            example based on the filename ;-)
            Best of both worlds? :-)

            Ciao,
            Thomas

            --
            Thomas Köhler Email: jean-luc@... | LCARS - Linux
            <>< WWW: http://jeanluc-picard.de | for Computers
            IRC: jeanluc | on All Real
            PGP public key available from Homepage! | Starships
          Your message has been successfully submitted and would be delivered to recipients shortly.