Author Topic: allow forking a buffer  (Read 63 times)

jporkkahtc

  • Senior Community Member
  • Posts: 1622
  • Hero Points: 149
  • Text
allow forking a buffer
« on: September 20, 2018, 12:34:26 am »
I'd like to fork() a buffer: The result is the current buffer is unmodified, but an exact copy is created as an unnamed buffer.

The new buffer should have identical undo/redo history.

Usage:
    Open a file, make a lot of edits.
    Regret: Oh, what have I done? I'd like to see the code part way thru my changes for comparison.
    Start hitting undo.
    Very carefully examine the old code
    Hope and prey that I've not trashed the redo buffer
    Hit redo to reapply my changes.

A fork() would basically let me check-point my code without fear of losing undo/redo.

File history is helpful here in some cases, *but* it always trashes undo/redo - very annoying!

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2446
  • Hero Points: 351
Re: allow forking a buffer
« Reply #1 on: September 20, 2018, 02:15:59 pm »
This won't give you the fork in a temp buffer, but in this scenario, I generally use File > Save Copy As... and put it in a temp directory.

You could easily record a fork() macro.  Select all, copy, open temp file, paste