Hi all,
I just pushed a new plugin (nodediff.py) that allows users to diff node
bodies. It's helpful for comparing, say, old and new versions of a
method, or by diffing @edit nodes to act like a traditional diff tool.
Here's the docstring:
----
Provides commands to run text diffs on node bodies within Leo.
By Jacob M. Peck
Configuration Settings
======================
This plugin is configured with the following @settings:
@string node-diff-style
-----------------------
One of 'compare', 'ndiff', or 'unified_diff'. Chooses which diff output
method
difflib uses to provide the diff. Defaults to 'compare'.
The various diff output methods are explained in the difflib documentation.
Commands
========
This plugin defines the following commands:
diff-marked
-----------
Runs a diff on the marked nodes. Only works if there are exactly two nodes
marked in the current outline.
diff-selected
-------------
Runs a diff on the selected nodes. Only works if there are exactly two
selected
nodes in the current outline.
diff-subtree
------------
Runs a diff on the children of the currently selected node. Only works
if the
selected node has exactly two children.
Common Usage
============
For those who don't use marked nodes for much else, the 'diff-marked' option
is probably the best. Mark two nodes and then execute 'diff-marked'.
The 'diff-subtree' option is the second most common option, and makes a lot
of sense for those who use clones regularly. Create an organizer node and
clone your two nodes to be diffed under that organizer node, then select
the organizer node and execute 'diff-subtree'.
The 'diff-selected' option is for those who use the mouse. Using Ctrl+click
or Shift+click, select exactly two nodes in the outline pane, and then
execute
'diff-selected'.
Scripting
=========
nodediff.py can be used by scripts to run any of the three styles of diff.
The following are available to scripts, and all of them take a list of two
positions as input::
c.theNodeDiffController.run_compare()
c.theNodeDiffController.run_ndiff()
c.theNodeDiffController.run_unified_diff()
----
Hope someone finds this useful!
-->Jake
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/groups/opt_out.