Skip to content

Commit

Permalink
Fix `logview-go-to-message-beginning' no longer activating region if …
Browse files Browse the repository at this point in the history
…called with prefix argument in Transient Mark mode.
  • Loading branch information
doublep committed May 9, 2018
1 parent 4f18720 commit bf9ecb5
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion logview.el
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ Transient Mark mode also activate the region."
(logview--locate-current-entry entry start
(goto-char (logview--entry-message-start entry start))
(when select-message
(push-mark (logview--entry-end entry start))))
(push-mark (logview--linefeed-back (logview--entry-end entry start)) t t)))
(unless (and select-message transient-mark-mode)
(logview--maybe-pulse-current-entry 'message-beginning))))

Expand Down
15 changes: 15 additions & 0 deletions test/log4j/navigation-1.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
2010-01-01 01:01:01.111 [thread 1] INFO class1 - message 1
2010-01-01 01:01:01.111 [thread 1] DEBUG class1 - message 2
2010-01-01 01:01:01.111 [thread 1] DEBUG class1 - message 3
2010-01-01 01:01:01.111 [thread 1] TRACE class1 - message 4
trace details, line 1
trace details, line 2
trace details, line 3
2010-01-01 01:01:01.111 [thread 1] INFO class1 - message 5
2010-01-01 01:01:01.111 [thread 1] WARN class1 - message 6
warning details
2010-01-01 01:01:01.111 [thread 1] DEBUG class1 - message 7
2010-01-01 01:01:01.111 [thread 1] DEBUG class1 - message 8
2010-01-01 01:01:01.111 [thread 1] INFO class1 - message 9
2010-01-01 01:01:01.111 [thread 1] ERROR class1 - message 10
error details
17 changes: 17 additions & 0 deletions test/logview.el
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,20 @@
;; Make sure that the second line is also recognized as an entry.
;; If it isn't, this will signal an error.
(logview-next-entry)))

(ert-deftest logview-test-go-to-message-beginning-1 ()
(logview--test-with-file "log4j/navigation-1.log"
(should (equal logview--submode-name "SLF4J"))
(forward-line 2)
(logview-go-to-message-beginning)
(should (looking-at "message 3$"))))

(ert-deftest logview-test-go-to-message-beginning-2 ()
(logview--test-with-file "log4j/navigation-1.log"
(should (equal logview--submode-name "SLF4J"))
(transient-mark-mode 1)
(forward-line 2)
(logview-go-to-message-beginning t)
(should (looking-at "message 3$"))
(should (string= (buffer-substring-no-properties (region-beginning) (region-end)) "message 3"))
(should (use-region-p))))

0 comments on commit bf9ecb5

Please sign in to comment.