-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: right padding for truncated line by symbols count (#48)
- Loading branch information
Showing
1 changed file
with
14 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
;; Author: Artur Yaroshenko <[email protected]> | ||
;; URL: https://github.com/artawower/blamer.el | ||
;; Package-Requires: ((emacs "27.1") (posframe "1.1.7") (async "1.9.8")) | ||
;; Version: 0.8.4 | ||
;; Version: 0.8.5 | ||
|
||
;; This program is free software; you can redistribute it and/or modify | ||
;; it under the terms of the GNU General Public License as published by | ||
|
@@ -197,7 +197,7 @@ This feature required Emacs built with `imagemagick'" | |
(defcustom blamer-avatar-size 96 | ||
"Size of avatar." | ||
:group 'blamer | ||
:type 'int) | ||
:type 'integer) | ||
|
||
(defcustom blamer-avatar-ratio '(3 . 3) | ||
"Image ration for avatar." | ||
|
@@ -207,7 +207,7 @@ This feature required Emacs built with `imagemagick'" | |
(defcustom blamer-avatar-cache-time 604800 | ||
"Time in seconds to cache avatar. Default value is 1 week." | ||
:group 'blamer | ||
:type 'int) | ||
:type 'integer) | ||
|
||
(defcustom blamer-avatar-folder "~/.blamer/avatars/" | ||
"Folder for avatars." | ||
|
@@ -317,6 +317,13 @@ author name by left click and copying commit hash by right click. | |
(const :tag "Info about author" blamer-tooltip-author-info) | ||
(const :tag "No tooltip" nil))) | ||
|
||
(defcustom blamer-symbol-count-before-new-line 0 | ||
"The number of characters before the end of the line. | ||
May be useful in some cases where the accuser unexpectedly | ||
moves to the next line." | ||
:group 'blamer | ||
:type 'integer) | ||
|
||
(defvar blamer-idle-timer nil | ||
"Current timer before commit info showing.") | ||
|
||
|
@@ -694,8 +701,11 @@ Works only for github right now." | |
|
||
(defun blamer--maybe-normalize-truncated-line (text) | ||
"Disable line break for truncated line by truncated TEXT for available width." | ||
|
||
(if (and (not truncate-lines) blamer-force-truncate-long-line) | ||
(truncate-string-to-width text (- (blamer--get-available-width-before-window-end) (blamer--get-line-number-column-width))) | ||
(truncate-string-to-width text (- (blamer--get-available-width-before-window-end) | ||
(blamer--get-line-number-column-width) | ||
blamer-symbol-count-before-new-line)) | ||
text)) | ||
|
||
(defun blamer--create-popup-msg (commit-info) | ||
|