Skip to content

Commit

Permalink
Scroll to position on "G" command
Browse files Browse the repository at this point in the history
Thing to consider: should `set-vim-position!` always scroll?

Closes issue #103
  • Loading branch information
takikawa committed May 6, 2016
1 parent 9ab37b8 commit 1bfd215
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions private/text.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,12 @@
(handle-command (repeat-command-command command)))]
[(? goto-command?)
(match-define (goto-command line) command)
(if (eq? line 'last-line)
(set-vim-position! (line-start-position (last-line)))
(set-vim-position! (line-start-position (sub1 line))))]
(define pos
(if (eq? line 'last-line)
(line-start-position (last-line))
(line-start-position (sub1 line))))
(set-vim-position! pos)
(scroll-to-position pos)]
[_ (handle-simple-command command)])

(unless (eq? command 'single-repeat)
Expand Down

0 comments on commit 1bfd215

Please sign in to comment.