Skip to content
Browse files

Simplify (vimgolf-solution-correct-p) to use (buffer-string)

  • Loading branch information...
1 parent 90cb045 commit a95883dcedad491e74c74445b8a0b03f967ea5b3 Adam Collard committed with
Showing with 3 additions and 8 deletions.
  1. +3 −8 emacs/vimgolf.el
11 emacs/vimgolf.el
@@ -187,14 +187,9 @@ unknown key sequence was entered).")
(defun vimgolf-solution-correct-p ()
"Return t if the work text is identical to the solution, nil otherwise."
- (let ((case-fold-search nil)
- (work vimgolf-work-buffer-name)
- (end vimgolf-end-buffer-name))
- (flet ((point-min-in (buf) (with-current-buffer buf (point-min)))
- (point-max-in (buf) (with-current-buffer buf (point-max))))
- (zerop (compare-buffer-substrings
- (get-buffer work) (point-min-in work) (point-max-in work)
- (get-buffer end) (point-min-in end) (point-max-in end))))))
+ (let ((working (with-current-buffer vimgolf-work-buffer-name (buffer-string)))
+ (end (with-current-buffer vimgolf-end-buffer-name (buffer-string))))
+ (string= working end)))
(defun vimgolf-wrong-solution ()
(message "Wrong!")

0 comments on commit a95883d

Please sign in to comment.
Something went wrong with that request. Please try again.