Thursday, August 22, 2013

Re: Disable swap file for large files?

Hi Charles!

On Do, 22 Aug 2013, Charles Campbell wrote:

> Christian Brabandt wrote:
> >On Thu, August 22, 2013 16:37, Ben Fritz wrote:
> >>On Thursday, August 22, 2013 1:25:29 AM UTC-5, Christian Brabandt wrote:
> >>>No. There are only two ways handling this. If you don't really change
> >>>
> >>>the buffer, you can disable the undo and later :rundo the
> >>>
> >>>existing undofiles.
> >>Woah, woah, woah!
> >>
> >>Could one theoretically add to the autocmd that detects a large file, to
> >>(before setting undolevels) do something like:
> >>
> >> bufdo let names[bufnr('%')] = tempname() | exe 'wundo' names[bufnr('%')]
> >>
> >>And then when closing the file/undoing the largefile settings,
> >>
> >> bufdo exe 'rundo' names[bufnr('%')]
> >>
> >>(with error handling and all that added of course).
> >>
> >>Probably would want to set 'nomodifiable' on all the buffers until the
> >>largefile settings were out of effect or something to prevent creating new
> >>changes not in the undo file.
> >>
> >Might work. Not sure, one wants to use several tempname() calls at all,
> >since tempname() is only guaranteed to give distinct names for 26 calls
> >and some plugins make use of tempname() themselves (so it could happen,
> >that plugins overwrite the undofile).
>
> I've been trying it out, but I'm going to have to put this mod down
> for now. I've got BufLeave events firing when they shouldn't.

Well, we should convince Bram then to include the undolevels local patch
then.

regards,
Christian
--
Der Tourist am Seeufer: Er sieht einen Tafel: "MÖVEN ZU VERKAUFEN".
Was kostet eine Möve?
DEM 2,60 das Stück.
Dann nehme ich gleich fünf.
Sehen sie sie, die Möven dort links oben, sie gehören nun ihnen.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: