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

bug in menu.vim (?)

Expand Messages
  • Coen Engelbarts
    Hi all, When running GUI Vim on VMS, the Color, Keymap and Compiler menus do not work correctly. The colorscheme menu has e.g. one submenu DISK:[USERNAME ,
    Message 1 of 1 , May 6, 2002
    • 0 Attachment
      Hi all,

      When running GUI Vim on VMS, the Color, Keymap and Compiler menus do not
      work correctly.
      The colorscheme menu has e.g. one submenu "DISK:[USERNAME", with one submenu
      "BIN", with one submenu "VIM", with several "COLORS<colorscheme>" entries,
      each with one submenu "VIM". Selecting "VIM" gives the corresponding
      colorscheme.
      I thought that I had narrowed it down to this line (line 313) of
      $VIM/menu.vim
      let s:name = substitute(s:name,
      '.*[/\\:]\([^/\\:_]*\)\(_[0-9a-zA-Z-]*\)\=\.vim', '\1', '')
      However, I am unable to fix it.

      This substitute() is intended to take the full path name of e.g.
      "/usr/bin/local/vim/colors/my_colorscheme.vim"
      and return "my_colorscheme". It then adds a menu entry with the name
      "my_colorscheme".
      However, on VMS the pathname is something like
      "DISK:[USERNAME.BIN.VIM.COLORS]MY_COLORSCHEME.VIM", and the substitute()
      returns "[USERNAME.BIN.VIM.COLOR]MY_COLORSCHEME.VIM.
      Note that this is different from what I see in the menu, as the first
      submenu is "DISK:[USERNAME" !

      I do not understand the substitute command completely, but I added a \] in
      the part that mathes the path, and
      let s:name = substitute(s:name,
      '.*[/\\:\]]\([^/\\:_]*\)\(_[0-9a-zA-Z-]*\)\=\.vim', '\1', '')
      returns the desired "my_colorscheme" on VMS.
      For completeness, I think it should have another \] in the filename part
      (i.e. the '\1' part):
      let s:name = substitute(s:name,
      '.*[/\\:\]]\([^/\\:_\]]*\)\(_[0-9a-zA-Z-]*\)\=\.vim', '\1', '')
      However, if I change menu.vim these ways and restart gvim, I still get the
      same (wrong) results.

      What am I missing?

      The same problem occurs with 3 menus:
      Color menu:
      let s:name = substitute(s:name,
      '.*[/\\:]\([^/\\:_]*\)\(_[0-9a-zA-Z-]*\)\=\.vim', '\1', '')
      Keymap menu:
      let s:name = substitute(s:name,
      '.*[/\\:]\([^/\\:_]*\)\(_[0-9a-zA-Z-]*\)\=\.vim', '\1', '')
      Compiler menu:
      let s:name = substitute(s:name, '.*[/\\:]\([^/\\:]*\)\.vim', '\1', '')
      and perhaps other menus that I did not notice.

      Shouldn't the substitute() in the compiler menu be the same as the others?
      Note that the problem does NOT occur in the syntax menu. Perhaps the method
      of makemenu.vim is a good solution for this?

      Please help/comment.
      Thanks in advance,

      Coen
    Your message has been successfully submitted and would be delivered to recipients shortly.