Undo: Difference between revisions

From PyMOLWiki
Jump to navigation Jump to search
m (Readding categories)
m (inline code format)
Line 15: Line 15:
</source>
</source>


`undo_enable` is an API-only feature that allows you enable undo.
<code>undo_enable</code> is an API-only feature that allows you enable undo.


<source lang="python">
<source lang="python">
Line 21: Line 21:
</source>
</source>


`undo_disable` is an API-only feature that allows you disable undo.
<code>undo_disable</code> is an API-only feature that allows you disable undo.


<source lang="python">
<source lang="python">
Line 37: Line 37:
Currently, undo support for builder is not available but will be supported in a later patch release.
Currently, undo support for builder is not available but will be supported in a later patch release.


For larger sessions, it may be suitable to manually turn off undo to save on memory usage (commands such as set will incur a high memory cost). Add `cmd.undo_disable()` in your pymolrc if you need to disable undo automatically upon startup.
For larger sessions, it may be suitable to manually turn off undo to save on memory usage (commands such as set will incur a high memory cost). Add <code>cmd.undo_disable()</code> in your pymolrc if you need to disable undo automatically upon startup.


For '''Incentive PyMOL''', all previous undo features are deprecated and will now be superseded by the one introduced in '''Incentive PyMOL 2.5'''.
For '''Incentive PyMOL''', all previous undo features are deprecated and will now be superseded by the one introduced in '''Incentive PyMOL 2.5'''.

Revision as of 12:25, 29 April 2021

(Incentive PyMOL only feature)

Most actions as of Incentive PyMOL 2.5 are undoable.

Actions are undoable via GUI menu (Edit -> Undo). The undo feature may be manually disabled by unchecking `Edit -> Undo Enabled`, and can be re-enabled by rechecking the same menu item.

Usage

undo [, steps]
  • steps = integer: number of steps to undo

PyMOL API

cmd.undo(int steps=1)

undo_enable is an API-only feature that allows you enable undo.

cmd.undo_enable()

undo_disable is an API-only feature that allows you disable undo.

cmd.undo_disable()

Example

 undo
 undo 5

Comments

Currently, the undo stack supports the previous 25 actions or up to 1GB memory used. These will later be configurable in an upcoming release.

Currently, undo support for builder is not available but will be supported in a later patch release.

For larger sessions, it may be suitable to manually turn off undo to save on memory usage (commands such as set will incur a high memory cost). Add cmd.undo_disable() in your pymolrc if you need to disable undo automatically upon startup.

For Incentive PyMOL, all previous undo features are deprecated and will now be superseded by the one introduced in Incentive PyMOL 2.5.

SEE ALSO

Redo