branch: externals/vlf
commit c3051e6131aaa69e6a166a91e42632a3ad2e3c67
Author: Andrey Kotlarski <[email protected]>
Commit: Andrey Kotlarski <[email protected]>
Show file position in percentages.
---
vlfi.el | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/vlfi.el b/vlfi.el
index 531511f..7462093 100644
--- a/vlfi.el
+++ b/vlfi.el
@@ -87,10 +87,13 @@ with the prefix argument DECREASE it is halved."
(defun vlfi-format-buffer-name ()
"Return format for vlfi buffer name."
- (format "%s(%s)[%d,%d](%d)"
- (file-name-nondirectory buffer-file-name)
- (file-size-human-readable vlfi-file-size)
- vlfi-start-pos vlfi-end-pos vlfi-batch-size))
+ (let ((vlfi-file-size-float (float vlfi-file-size)))
+ (format "%s(%s)[%.2f-%.2f%%%%](%d)"
+ (file-name-nondirectory buffer-file-name)
+ (file-size-human-readable vlfi-file-size)
+ (* 100 (/ vlfi-start-pos vlfi-file-size-float))
+ (* 100 (/ vlfi-end-pos vlfi-file-size-float))
+ vlfi-batch-size)))
(defun vlfi-update-buffer-name ()
"Update the current buffer name."