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

Re: Feature request: enable undo after reloading file

Expand Messages
  • James Longstreet
    ... It s a bit messy from first glance, but I was able to find some MIT-licensed diff code in C: http://www.ioplex.com/~miallen/libmba/dl/src/diff.c
    Message 1 of 9 , Nov 5, 2007
    • 0 Attachment
      On 11/5/07, Bram Moolenaar <Bram@...> wrote:
      > I once looked into including diff code into Vim, but could only find
      > code that is relatively complicated. If someone knows a nice,
      > well-behaving, small diff algorithm implementation in C that would help
      > a lot.

      It's a bit messy from first glance, but I was able to find some
      MIT-licensed diff code in C:
      http://www.ioplex.com/~miallen/libmba/dl/src/diff.c

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_dev" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Fan Decheng
      ... Hehe, a workaround: choose OK rather than Load . When you are ready to reload it, use :e . -- Fan Decheng dtsfan@citiz.net
      Message 2 of 9 , Nov 6, 2007
      • 0 Attachment
        Alexei Alexandrov wrote:
        > Hi,
        >
        > I'd like to request a feature in Vim which would be useful not very often but
        > is very important I think.
        >
        > Usually I don't lose information in Vim. You can undo things, you can restore
        > the file from a backup etc. There is only one situation which led me to
        > information loss several times. This situation happens when I have a file with
        > modifications opened in Vim and then I also change this file by accident
        > outside of Vim. In this case Vim shows a message box with 2 buttons: reload
        > file or don't reload file. Several times I pressed "reload file" by accident.
        > And my changes in Vim were lost! Undo didn't work after that.
        >
        > I don't know if it's difficult to implement but it would be great if undo
        > worked after such reload. And this would be useful not only for "by accident"
        > cases - I could also press "reload" just to see what those external changes are
        > and then undo if I don't need them.
        >
        > P.S. Persistent undo would be great too. :)
        >
        >
        > >
        >
        >
        >
        Hehe, a workaround: choose "OK" rather than "Load". When you are ready
        to reload it, use :e .

        --
        Fan Decheng
        dtsfan@...



        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_dev" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Bram Moolenaar
        ... Thanks. This indeed looks short enough to include in Vim, and the MIT license is permissive. Now we need someone to integrate this with Vim. Volunteer?
        Message 3 of 9 , Nov 6, 2007
        • 0 Attachment
          James Longstreet wrote:

          > On 11/5/07, Bram Moolenaar <Bram@...> wrote:
          > > I once looked into including diff code into Vim, but could only find
          > > code that is relatively complicated. If someone knows a nice,
          > > well-behaving, small diff algorithm implementation in C that would help
          > > a lot.
          >
          > It's a bit messy from first glance, but I was able to find some
          > MIT-licensed diff code in C:
          > http://www.ioplex.com/~miallen/libmba/dl/src/diff.c

          Thanks. This indeed looks short enough to include in Vim, and the MIT
          license is permissive.

          Now we need someone to integrate this with Vim. Volunteer?
          The result should be that diff mode works faster and more reliable.
          This means we don't need ":diffupdate" much.

          And later we could use it to do this undo-after-file-load feature.

          --
          Warning label on a superhero Halloween costume:
          "Caution: Cape does not enable user to fly."

          /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
          /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
          \\\ download, build and distribute -- http://www.A-A-P.org ///
          \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

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