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

pressing saves the editing file without the possibility to undo

Expand Messages
  • Cesar Romani
    If I m editing a file and then press , I get the help page and when I come back to my editing page, it is saved and without the possibility to undo what
    Message 1 of 6 , May 25 11:24 PM
    • 0 Attachment
      If I'm editing a file and then press <F1>, I get the help page and when
      I come back to my editing page, it is saved and without the possibility
      to undo what I've already written. If I press u, it says "Already at
      oldest change".
      Is there the possibility to undo an editing file after I've pressed the
      <F1> key?
      Many thanks in advance,
      Cesar


      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Tim Chase
      ... This sounds peculiar -- normally splits off the help in a new window. This suggests to me that you re running a stripped-down version of Vim
      Message 2 of 6 , May 26 3:59 AM
      • 0 Attachment
        > If I'm editing a file and then press <F1>, I get the help page
        > and when I come back to my editing page, it is saved and
        > without the possibility to undo what I've already written. If
        > I press u, it says "Already at oldest change". Is there the
        > possibility to undo an editing file after I've pressed the
        > <F1> key?


        This sounds peculiar -- normally <f1> splits off the help in a
        new window. This suggests to me that you're running a
        stripped-down version of Vim ("vim.tiny" or "vim-minimal" in some
        versions). Could you include the output of

        :version

        I'm particularly interested in whether your build was created
        with "+windows".

        You can also test using

        :new

        to see if you get a new empty window, or if you just get an empty
        file.

        It would also help to see the output from

        :set hidden?

        Lastly, output from

        :map

        might show an overriding mapping that's the culprit.

        -tim





        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Cesar Romani
        ... I m running a big version of vim 7.2.184 created with +windows If I do ... set hidden? - nohidden I think the culprit is
        Message 3 of 6 , May 26 9:12 AM
        • 0 Attachment
          Tim Chase wrote:
          >> If I'm editing a file and then press <F1>, I get the help page
          >> and when I come back to my editing page, it is saved and
          >> without the possibility to undo what I've already written. If
          >> I press u, it says "Already at oldest change". Is there the
          >> possibility to undo an editing file after I've pressed the
          >> <F1> key?
          >
          >
          > This sounds peculiar -- normally <f1> splits off the help in a
          > new window. This suggests to me that you're running a
          > stripped-down version of Vim ("vim.tiny" or "vim-minimal" in some
          > versions). Could you include the output of
          >
          > :version
          >
          > I'm particularly interested in whether your build was created
          > with "+windows".
          >
          > You can also test using
          >
          > :new
          >
          > to see if you get a new empty window, or if you just get an empty
          > file.
          >
          > It would also help to see the output from
          >
          > :set hidden?
          >
          > Lastly, output from
          >
          > :map
          >
          > might show an overriding mapping that's the culprit.

          I'm running a big version of vim 7.2.184 created with +windows If I do
          :new I get a new window split horizontally from the original one.
          set hidden? -> nohidden

          I think the culprit is

          C:\Programmi\Vim\vimfiles\after\ftplugin\help.vim

          which contains the line

          wincmd o

          That's the reason why I don't get the window split when I press <F1>. Is
          there the possibility that when I press <F1>, the file isn't saved or at
          least have the possibility of undoing or is it better to get rid of
          ..\after\ftplugin\help.vim?

          Many thanks in advance,
          Cesar


          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_use" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • Tim Chase
          ... wow. Yeah, that would do it. I m not sure what was desired when creating this, but it looks like some add-on filetype rather than one that comes with the
          Message 4 of 6 , May 26 9:37 AM
          • 0 Attachment
            > I think the culprit is
            >
            > C:\Programmi\Vim\vimfiles\after\ftplugin\help.vim
            >
            > which contains the line
            >
            > wincmd o

            wow. Yeah, that would do it. I'm not sure what was desired when
            creating this, but it looks like some add-on filetype rather than
            one that comes with the stock build of Vim. But I'm boggled by
            the apparent bogosity. :)

            > That's the reason why I don't get the window split when I press <F1>. Is
            > there the possibility that when I press <F1>, the file isn't saved or at
            > least have the possibility of undoing or is it better to get rid of
            > ..\after\ftplugin\help.vim?

            Since the stuff in the after\ directory should be user-controlled
            (rather than vim-distribution-controlled), you should be able to
            nuke or edit the file with impunity. I'd just blow away that
            line unless you smell other bad mojo in the
            after\ftplugin\help.vim file in which case you should be able to
            just nuke the file.

            -tim




            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_use" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          • Matt Wozniski
            ... What he said, and also... you would still be able to undo in the old file despite this if you used :set hidden. The best summary I can give of what the
            Message 5 of 6 , May 26 10:03 AM
            • 0 Attachment
              On Tue, May 26, 2009 at 12:37 PM, Tim Chase wrote:
              >
              >> I think the culprit is
              >>
              >> C:\Programmi\Vim\vimfiles\after\ftplugin\help.vim
              >>
              >> which contains the line
              >>
              >> wincmd o
              >
              > wow.  Yeah, that would do it.  I'm not sure what was desired when
              > creating this, but it looks like some add-on filetype rather than
              > one that comes with the stock build of Vim.  But I'm boggled by
              > the apparent bogosity. :)
              >
              >> That's the reason why I don't get the window split when I press <F1>. Is
              >> there the possibility that when I press <F1>, the file isn't saved or at
              >> least have the possibility of undoing or is it better to get rid of
              >> ..\after\ftplugin\help.vim?
              >
              > Since the stuff in the after\ directory should be user-controlled
              > (rather than vim-distribution-controlled), you should be able to
              > nuke or edit the file with impunity.  I'd just blow away that
              > line unless you smell other bad mojo in the
              > after\ftplugin\help.vim file in which case you should be able to
              > just nuke the file.

              What he said, and also... you would still be able to undo in the old
              file despite this if you used :set hidden. The best summary I can
              give of what the 'hidden' option does is this:

              By default, whenever a buffer will no longer be displayed in any
              windows, it must first be saved, and then will be forgotten about.
              The 'hidden' option changes this behavior. It lets you keep a file
              open and unsaved, even when it isn't still being displayed, and lets
              you keep undo and redo history when you come back to that file.

              This makes working with multiple files much more pleasant. Don't
              worry, though - Vim will force you to either save the buffer or
              choose to throw it away before it will let you exit.

              'hidden' is definitely an option that I would recommend that everyone
              set in his vimrc.

              ~Matt

              --~--~---------~--~----~------------~-------~--~----~
              You received this message from the "vim_use" maillist.
              For more information, visit http://www.vim.org/maillist.php
              -~----------~----~----~----~------~----~------~--~---
            • Tony Mechelynck
              On 26/05/09 19:03, Matt Wozniski wrote: [...] ... I wouldn t. I don t like having hidden, maybe unsaved, files, that aren t displayed in a window. Personally I
              Message 6 of 6 , May 31 7:18 PM
              • 0 Attachment
                On 26/05/09 19:03, Matt Wozniski wrote:
                [...]
                > 'hidden' is definitely an option that I would recommend that everyone
                > set in his vimrc.
                >
                > ~Matt

                I wouldn't. I don't like having hidden, maybe unsaved, files, that
                aren't displayed in a window. Personally I set 'autowriteall', and it
                makes my editing more pleasant, but I wouldn't recommend that to
                everyone either: what this option does is save the file rather than hide
                it or |abandon| it. The alternative, with none of 'hidden', 'autowrite'
                or 'autowriteall', is the default behaviour: if you try to "abandon" a
                window which contains a modified file, and your ex-command doesn't end
                in an exclamation mark, Vim will protest and refuse to close the window.
                You can then decide whether to save the file (e.g. by using :wq or :x
                rather than :q, or :w|e foobar rather than :e foobar), or not (:q! or
                :e! foobar), before closing the window or reusing it for a different file.


                What I would certainly _not_ recommend is forcing the help window to
                close all other windows, as the OP found that his after-plugin did: that
                would defeat the |+windows| feature of Vim: imagine a Vim version where
                you can open split-windows with no problem _but_ they all disappear if
                you use the help? The mere notion makes me shudder.

                Rather, I use the following to have the help window (if any) positiopned
                more or less "predictably" (i.e. always at the bottom, unless of course
                I later open a new split-window under it):

                " open help window at bottom unless :help typed in full
                if version < 700
                cnoreabbrev h bot h
                else
                cnoreabbrev <expr> h
                \ ((getcmdtype() == ':' && getcmdpos() <= 2)? 'bot h' : 'h')
                endif
                map <F1> :bot help<CR>



                Best regards,
                Tony.
                --
                It is illegal to drive more than two thousand sheep down Hollywood
                Boulevard at one time.

                --~--~---------~--~----~------------~-------~--~----~
                You received this message from the "vim_use" maillist.
                For more information, visit http://www.vim.org/maillist.php
                -~----------~----~----~----~------~----~------~--~---
              Your message has been successfully submitted and would be delivered to recipients shortly.