Skip to content

Commit

Permalink
[ADD] Customization for lines kept in view
Browse files Browse the repository at this point in the history
  • Loading branch information
KeyWeeUsr committed Feb 25, 2024
1 parent cbc26d5 commit d6c7e13
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion typewriter-roll-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,22 @@

;;; Code:

(defgroup typewriter-roll
nil
"Customizatino group for `typewriter-roll-mode'."
:group 'convenience
:group 'editing
:group 'text)

(defcustom typewriter-roll-keep-in-focus
0
"Previous lines to keep in view."
:group 'typewriter-roll
:type 'number)

(defsubst typewriter-roll--scroll-up ()
"Scroll current line to the top."
(recenter-top-bottom 0))
(recenter-top-bottom typewriter-roll-keep-in-focus))

(defsubst typewriter-roll--scroll-or-nothing (pos)
"Scroll if the cursor POS changed (content wrapped)."
Expand Down

0 comments on commit d6c7e13

Please sign in to comment.