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

M$W2000: Edit->Copy dosn't work after filetype on

Expand Messages
  • Milan Vancura
    Hi all, ... NOTE: Filetypes and compatible don t work together well, since being Vi compatible means options are global. Resetting compatible is
    Message 1 of 6 , Aug 30, 2002
    • 0 Attachment
      Hi all,

      :help :filetype says:

      -----
      NOTE: Filetypes and 'compatible' don't work together well, since being Vi
      compatible means options are global. Resetting 'compatible' is recommended,
      if you didn't do that already.
      -----

      Does "Resetting 'compatible'" mean "set nocompatible" ?

      If I run vim with vimrc

      set nocompatible
      filetype on

      Edit->Copy/Cut from main pulldown menu doesn't work. It do something, but the
      visual block stays untouched, nothing is put to clipboard register, but vim
      "thinks" there is something and change Edit menu to allow Paste. It will fail,
      of course.

      I use vim6.1 binaries and runtime files from vim.org under M$W2000.

      Clicking on scissors icon or Cut/Copy from mouse pull-down menu (on right-click
      event) still works OK.

      If I _set_ the compatible option before "filetype on", edit->Cut/Copy works OK
      (but I didn't do so many tests I can say I don't see any other problem).

      Is there a little bug in vim, in a help file or I don't know what does
      "resetting" mean or the vim needs under M$Win are else then under UNIX?

      Thanks,

      Milan Vancura

      P.S.: I'm sorry in advance if the whole problem is my little knowledge of
      English.
    • Bram Moolenaar
      ... Yes. ... Very strange, since these menus and toolbar buttons all use the same commands. Perhaps some script redefined the menus? Try doing :menu
      Message 2 of 6 , Aug 30, 2002
      • 0 Attachment
        Milan Vancura wrote:

        > :help :filetype says:
        >
        > -----
        > NOTE: Filetypes and 'compatible' don't work together well, since being Vi
        > compatible means options are global. Resetting 'compatible' is recommended,
        > if you didn't do that already.
        > -----
        >
        > Does "Resetting 'compatible'" mean "set nocompatible" ?

        Yes.

        > If I run vim with vimrc
        >
        > set nocompatible
        > filetype on
        >
        > Edit->Copy/Cut from main pulldown menu doesn't work. It do something, but the
        > visual block stays untouched, nothing is put to clipboard register, but vim
        > "thinks" there is something and change Edit menu to allow Paste. It will fail,
        > of course.
        >
        > I use vim6.1 binaries and runtime files from vim.org under M$W2000.
        >
        > Clicking on scissors icon or Cut/Copy from mouse pull-down menu (on
        > right-click event) still works OK.

        Very strange, since these menus and toolbar buttons all use the same
        commands. Perhaps some script redefined the menus?

        Try doing ":menu Edit.Copy" and check what the output is in the
        situation when it works and when it doesn't work.

        --
        Proverb: A nightingale that forgets the lyrics is a hummingbird.

        /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
        /// Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim \\\
        \\\ Project leader for A-A-P -- http://www.a-a-p.org ///
        \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///
      • Milan Vancura
        ... Not any my script, I run virgin gvim only. runtime menu.vim (re)defines all basic menus (File,Edit etc.) when it is called from runtime filetype.vim. But
        Message 3 of 6 , Sep 2 2:39 AM
        • 0 Attachment
          > Very strange, since these menus and toolbar buttons all use the same
          > commands. Perhaps some script redefined the menus?

          Not any my script, I run "virgin gvim" only. runtime\menu.vim (re)defines all
          basic menus (File,Edit etc.) when it is called from runtime\filetype.vim. But
          the problems are elsewhere.

          set nocompatible
          let did_install_syntax_menu=1
          filetype on

          works OK.

          Little tracing mechanism shows me that if I don't set this variable before
          "filetype on", menu.vim is executed twice. Firstly with all three conditions
          passed (default_menu, syntax_menu and syntax_menu2), secondly with all
          conditions skipped (so nothing is done).

          If I set the variable, there is only one pass of menu.vim and only the first
          condition (default_menu) is done, other two are skipped.

          The problem is why the code in the "syntax menu conditions" does so strange
          things. Very strange. For example if I mark a visual block and do Edit.Copy
          three or four times, vim will crash. ("gvim.exe generated error and will be
          restarted by Windows system.")

          Milan Vancura
        • Bram Moolenaar
          ... I have no explanation for this behavior. Don t forget that this works just fine for most people. Thus there must be something special about your
          Message 4 of 6 , Sep 2 10:01 AM
          • 0 Attachment
            Milan Vancura wrote:

            > > Very strange, since these menus and toolbar buttons all use the same
            > > commands. Perhaps some script redefined the menus?
            >
            > Not any my script, I run "virgin gvim" only. runtime\menu.vim (re)defines all
            > basic menus (File,Edit etc.) when it is called from runtime\filetype.vim. But
            > the problems are elsewhere.
            >
            > set nocompatible
            > let did_install_syntax_menu=1
            > filetype on
            >
            > works OK.
            >
            > Little tracing mechanism shows me that if I don't set this variable before
            > "filetype on", menu.vim is executed twice. Firstly with all three conditions
            > passed (default_menu, syntax_menu and syntax_menu2), secondly with all
            > conditions skipped (so nothing is done).
            >
            > If I set the variable, there is only one pass of menu.vim and only the first
            > condition (default_menu) is done, other two are skipped.
            >
            > The problem is why the code in the "syntax menu conditions" does so strange
            > things. Very strange. For example if I mark a visual block and do Edit.Copy
            > three or four times, vim will crash. ("gvim.exe generated error and will be
            > restarted by Windows system.")

            I have no explanation for this behavior. Don't forget that this works
            just fine for most people. Thus there must be something special about
            your situation that causes the problem. Any idea? Are you using
            translated menus perhaps?

            --
            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 -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim \\\
            \\\ Project leader for A-A-P -- http://www.a-a-p.org ///
            \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///
          • Milan Vancura
            ... I have made some new tests. All problems with Edit.Copy/Cut/Paste become if and only if menu.vim is sourced from filetype.vim (lines 1376-1381). It
            Message 5 of 6 , Sep 5 1:33 AM
            • 0 Attachment
              > > The problem is why the code in the "syntax menu conditions" does so strange
              > > things. Very strange. For example if I mark a visual block and do Edit.Copy
              > > three or four times, vim will crash. ("gvim.exe generated error and will be
              > > restarted by Windows system.")
              >
              > I have no explanation for this behavior. Don't forget that this works
              > just fine for most people. Thus there must be something special about
              > your situation that causes the problem. Any idea? Are you using
              > translated menus perhaps?

              I have made some new tests.

              All problems with Edit.Copy/Cut/Paste become "if and only if" menu.vim is
              sourced from filetype.vim (lines 1376-1381). It doesn't depend on setting menu
              items, syntax and anything else.

              I used the binary package "GUI vim" + vim rt files package from vim.org. The
              "Self-installing executable" vim from vim.org (which I have installed now)
              doesn't have this problem.

              Maybe I did something wrong before, maybe it's an error on my system and maybe
              there is some error in "GUI executable" vim at vim.org. I think testing it on
              the system of someone else could be a good idea.

              Have a nice day,

              Milan
            • Bram Moolenaar
              ... How do you make sure that menu.vim is sourced from filetype.vim? Anyway, starting Vim with -V shows me it s done this way for me. I don t see these
              Message 6 of 6 , Sep 5 2:14 PM
              • 0 Attachment
                Milan Vancura wrote:

                > > > The problem is why the code in the "syntax menu conditions" does
                > > > so strange things. Very strange. For example if I mark a visual
                > > > block and do Edit.Copy three or four times, vim will crash.
                > > > ("gvim.exe generated error and will be restarted by Windows
                > > > system.")
                > >
                > > I have no explanation for this behavior. Don't forget that this works
                > > just fine for most people. Thus there must be something special about
                > > your situation that causes the problem. Any idea? Are you using
                > > translated menus perhaps?
                >
                > I have made some new tests.
                >
                > All problems with Edit.Copy/Cut/Paste become "if and only if" menu.vim
                > is sourced from filetype.vim (lines 1376-1381). It doesn't depend on
                > setting menu items, syntax and anything else.

                How do you make sure that menu.vim is sourced from filetype.vim?
                Anyway, starting Vim with "-V" shows me it's done this way for me. I
                don't see these problems though.

                > I used the binary package "GUI vim" + vim rt files package from vim.org. The
                > "Self-installing executable" vim from vim.org (which I have installed now)
                > doesn't have this problem.

                Which binary package is that? gvim61.zip? It is compiled in the same
                way as the one included with the self-installing executable, only with
                less features.

                > Maybe I did something wrong before, maybe it's an error on my system
                > and maybe there is some error in "GUI executable" vim at vim.org. I
                > think testing it on the system of someone else could be a good idea.

                Since you reported a crash, I would suspect something went wrong with
                downloading that specific gvim.exe.

                --
                LAUNCELOT: I am, sir. I am a Knight of King Arthur.
                FATHER: 'Mm ... very nice castle, Camelot ... very good pig country....
                "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

                /// 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 ///
                \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///
              Your message has been successfully submitted and would be delivered to recipients shortly.