[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 0c9d8b6 52/92: Added 'd' hotkey and left/light paths to th
From: |
Alexey Veretennikov |
Subject: |
[elpa] master 0c9d8b6 52/92: Added 'd' hotkey and left/light paths to the header |
Date: |
Thu, 11 Jun 2015 19:48:08 +0000 |
branch: master
commit 0c9d8b6f9af270bf193cdb973a0958df9f6d6e64
Author: Alexey Veretennikov <address@hidden>
Commit: Alexey Veretennikov <address@hidden>
Added 'd' hotkey and left/light paths to the header
---
README.md | 3 ++-
ztree-diff.el | 32 ++++++++++++++++++++++++++++++--
2 files changed, 32 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index 0bded3d..5f62493 100644
--- a/README.md
+++ b/README.md
@@ -50,8 +50,9 @@ Then you need to specify the left and right directories to
compare.
###Hotkeys supported
The basic hotkeys are the same as in the **ztree-dir**. Additionally:
* `RET` or `Space` on different files starts the **Ediff**
+ * `d` key show the simple diff window for the current file instead of
**Ediff**
* `TAB` to fast switch between panels
- * `h` key toggle show/hide identical files/directories
+ * `h` key to toggle show/hide identical files/directories
* `C` key to copy current file or directory to the left or right panel
* `D` key to delete current file or directory
* `v` key to quick view the current file
diff --git a/ztree-diff.el b/ztree-diff.el
index 2e8cce8..020f646 100644
--- a/ztree-diff.el
+++ b/ztree-diff.el
@@ -93,6 +93,7 @@ including . and ..")
(,(kbd "h") . ztree-diff-toggle-show-equal-files)
(,(kbd "D") . ztree-diff-delete-file)
(,(kbd "v") . ztree-diff-view-file)
+ (,(kbd "d") . ztree-diff-simple-diff-files)
([f5] . ztree-diff-full-rescan)))
@@ -105,7 +106,14 @@ including . and ..")
(defun ztree-diff-insert-buffer-header ()
(insert-with-face "Differences tree" ztreep-diff-header-face)
(newline)
- (insert-with-face"Legend:" ztreep-diff-header-small-face)
+ (when ztree-diff-dirs-pair
+ (insert-with-face (concat "Left: " (car ztree-diff-dirs-pair))
+ ztreep-diff-header-small-face)
+ (newline)
+ (insert-with-face (concat "Right: " (cdr ztree-diff-dirs-pair))
+ ztreep-diff-header-small-face)
+ (newline))
+ (insert-with-face "Legend:" ztreep-diff-header-small-face)
(newline)
(insert-with-face " Normal file " ztreep-diff-model-normal-face)
(insert-with-face "- same on both sides" ztreep-diff-header-small-face)
@@ -127,6 +135,24 @@ including . and ..")
(ztree-diff (car ztree-diff-dirs-pair) (cdr ztree-diff-dirs-pair))))
+(defun ztree-diff-simple-diff-files ()
+ "Create a simple diff buffer for files from left and right panels"
+ (interactive)
+ (let ((found (ztree-find-node-at-point)))
+ (when found
+ (let* ((node (car found))
+ (node-left (ztree-diff-node-left-path node))
+ (node-right (ztree-diff-node-right-path node)))
+ (when (and
+ node-left
+ node-right
+ (not (file-directory-p node-left)))
+ ;; show the diff window on the bottom
+ ;; to not to crush tree appearance
+ (let ((split-width-threshold nil))
+ (diff node-left node-right)))))))
+
+
(defun ztree-diff-node-action (node)
(let ((left (ztree-diff-node-left-path node))
(right (ztree-diff-node-right-path node)))
@@ -341,7 +367,9 @@ apparently shall not be visible"
'ztree-diff-node-action
'ztree-diff-node-side)
(ztreediff-mode)
- (setq ztree-diff-dirs-pair (cons dir1 dir2))))
+ (setq ztree-diff-dirs-pair (cons dir1 dir2))
+ (ztree-refresh-buffer)))
+
- [elpa] master d590f88 40/92: Added minor mode for ztree diff, to create custom keybindings, (continued)
- [elpa] master d590f88 40/92: Added minor mode for ztree diff, to create custom keybindings, Alexey Veretennikov, 2015/06/11
- [elpa] master 81b6a4b 49/92: Added delete functionality, Alexey Veretennikov, 2015/06/11
- [elpa] master c3580db 46/92: Updated readme; renamed the ztree to ztree-dir, Alexey Veretennikov, 2015/06/11
- [elpa] master 3867ed3 45/92: Implemented support for hiding matched(equal) files, Alexey Veretennikov, 2015/06/11
- [elpa] master 15baed9 50/92: Repaired full rescan; added 'v' keybinding to quickly view files, Alexey Veretennikov, 2015/06/11
- [elpa] master 7f1ec58 53/92: Fixed topmost name in comparison tree, Alexey Veretennikov, 2015/06/11
- [elpa] master 56dce0e 51/92: Updated README, Alexey Veretennikov, 2015/06/11
- [elpa] master d791ebe 54/92: Readme is updated, Alexey Veretennikov, 2015/06/11
- [elpa] master 8ba9ca2 55/92: Added simple diff by using SPACE, Alexey Veretennikov, 2015/06/11
- [elpa] master c816a66 56/92: Updated readme, Alexey Veretennikov, 2015/06/11
- [elpa] master 0c9d8b6 52/92: Added 'd' hotkey and left/light paths to the header,
Alexey Veretennikov <=
- [elpa] master a45a108 57/92: Logical operation on the file by pressing either RET or SPC - diff/ediff when different view/open when same, Alexey Veretennikov, 2015/06/11
- [elpa] master ba34d9c 58/92: Updated readme, Alexey Veretennikov, 2015/06/11
- [elpa] master 56320ab 62/92: Fix footer line and add Code section header, Alexey Veretennikov, 2015/06/11
- [elpa] master 11bcff0 60/92: Updated docstrings; removed debug print from partial rescan, Alexey Veretennikov, 2015/06/11
- [elpa] master 865afb0 59/92: Implemented partial rescan/refresh feature ('r' hotkey), Alexey Veretennikov, 2015/06/11
- [elpa] master 15f376d 63/92: Add -pkg.el file, Alexey Veretennikov, 2015/06/11
- [elpa] master 7530053 64/92: Merge pull request #2 from yasuyk/patch-1, Alexey Veretennikov, 2015/06/11
- [elpa] master 0642c05 61/92: Updated readme, Alexey Veretennikov, 2015/06/11
- [elpa] master bd7547b 66/92: Add autoload cookies, Alexey Veretennikov, 2015/06/11
- [elpa] master c81ae1f 65/92: Merge pull request #3 from yasuyk/patch-2, Alexey Veretennikov, 2015/06/11