[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 5127bfd 20/68: ace-window.el (aw-generic): finalize improv
From: |
Oleh Krehel |
Subject: |
[elpa] master 5127bfd 20/68: ace-window.el (aw-generic): finalize improve for hscroll |
Date: |
Sat, 21 Mar 2015 19:06:53 +0000 |
branch: master
commit 5127bfdaaed4e4fc30654cf5e5e78c2044585cb3
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
ace-window.el (aw-generic): finalize improve for hscroll
* ace-window.el (aw-offset): New function.
The issue with top left part of the window being after the newline,
i.e. it can't be written to without modifying the buffer, is fixed
by displaying the jump character on the next available line.
Fixes #11.
---
ace-window.el | 21 +++++++++++++++++++--
1 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/ace-window.el b/ace-window.el
index 26f7d51..a9e2001 100644
--- a/ace-window.el
+++ b/ace-window.el
@@ -152,8 +152,8 @@ HANDLER is a function that takes a window argument."
(with-current-buffer b
(insert " "))))
(make-aj-position
- :offset (+ (window-start
(aj-visual-area-window va))
- (window-hscroll
(aj-visual-area-window va)))
+ :offset
+ (aw-offset (aj-visual-area-window va))
:visual-area va))
visual-area-list)))
;; create background for each visual area
@@ -281,6 +281,23 @@ Windows are numbered top down, left to right."
(get-buffer-window (current-buffer))
window))))))
+(defun aw-offset (window)
+ "Return point in WINDOW that's closest to top left corner.
+The point is writable, i.e. it's not part of space after newline."
+ (let ((h (window-hscroll window))
+ (beg (window-start window))
+ (end (window-end window)))
+ (with-current-buffer
+ (window-buffer window)
+ (save-excursion
+ (goto-char beg)
+ (while (and (< (point) end)
+ (< (- (line-end-position)
+ (line-beginning-position))
+ h))
+ (forward-line))
+ (+ (point) h)))))
+
(provide 'ace-window)
;;; ace-window.el ends here
- [elpa] master 291e93f 10/68: ace-window.el (aw-list-visual-area): autoload, (continued)
- [elpa] master 291e93f 10/68: ace-window.el (aw-list-visual-area): autoload, Oleh Krehel, 2015/03/21
- [elpa] master 45c97bb 11/68: Fix selection when two single-window frames, Oleh Krehel, 2015/03/21
- [elpa] master c3a9242 06/68: ace-window.el: add move and delete functionality, Oleh Krehel, 2015/03/21
- [elpa] master fc95979 14/68: Remove ace-jump-mode-make-indirect-buffer, Oleh Krehel, 2015/03/21
- [elpa] master 4de62ee 15/68: Merge pull request #8 from kyleam/ace-jump-update, Oleh Krehel, 2015/03/21
- [elpa] master dd44ece 13/68: ace-window.el (aw-delete-window): allow to delete current window, Oleh Krehel, 2015/03/21
- [elpa] master 18f300a 12/68: Merge pull request #5 from kyleam/fix-selection, Oleh Krehel, 2015/03/21
- [elpa] master f0b55c8 18/68: Merge pull request #9 from demon386/master, Oleh Krehel, 2015/03/21
- [elpa] master 8f20278 16/68: ace-window.el (aw-generic): switch to cl-position, Oleh Krehel, 2015/03/21
- [elpa] master 6053545 17/68: Respect `aw-scope' when jumping with `next-window', Oleh Krehel, 2015/03/21
- [elpa] master 5127bfd 20/68: ace-window.el (aw-generic): finalize improve for hscroll,
Oleh Krehel <=
- [elpa] master 12a34df 19/68: ace-window.el (aw-generic): improve for hscroll, Oleh Krehel, 2015/03/21
- [elpa] master 1082953 24/68: ace-window.el: add custom buffer ignoring, Oleh Krehel, 2015/03/21
- [elpa] master c351368 23/68: ace-window.el (aw-visual-area<): improve., Oleh Krehel, 2015/03/21
- [elpa] master 9020f42 22/68: ace-window.el (ace-window): update doc, Oleh Krehel, 2015/03/21
- [elpa] master 56d4aee 27/68: ace-window.el: tag 0.5.0, Oleh Krehel, 2015/03/21
- [elpa] master 5174ca2 25/68: ace-window.el (aw-generic): handle zero-length read-only buffers better, Oleh Krehel, 2015/03/21
- [elpa] master 0e821a2 29/68: ace-window.el (aw-offset): use inhibit-field-text-motion t, Oleh Krehel, 2015/03/21
- [elpa] master e0531fd 26/68: ace-window.el: add work-around for autoload, Oleh Krehel, 2015/03/21
- [elpa] master b7b8e72 28/68: ace-window.el (aw-list-visual-area): improve, Oleh Krehel, 2015/03/21
- [elpa] master f7001fb 33/68: ace-window.el (aw-background): new custom, Oleh Krehel, 2015/03/21