summaryrefslogtreecommitdiff
path: root/lisp/eshell
diff options
context:
space:
mode:
authorVibhav Pant <vibhavp@gmail.com>2015-10-28 22:37:34 +0530
committerVibhav Pant <vibhavp@gmail.com>2015-10-29 03:08:10 +0530
commit2765945d616f9661dd0aa641f4ecd328dd8768d7 (patch)
tree1ba0fa605084786316bd3d8e4ccc0ea209009fa2 /lisp/eshell
parentd8f82d8199198aa0133aa4dea75643f13e551d26 (diff)
downloademacs-2765945d616f9661dd0aa641f4ecd328dd8768d7.tar.gz
Fix eshell/clear not working if the output has a small line count
* lisp/eshell/esh-mode.el: (eshell/clear): Use (window-size) as the number of newlines to be inserted. This fixes the issue where eshell/clear wouldn't work if the prompt was not at the bottom of the window, and the output wasn't too long.
Diffstat (limited to 'lisp/eshell')
-rw-r--r--lisp/eshell/esh-mode.el5
1 files changed, 2 insertions, 3 deletions
diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el
index 3df820d5956..9cc9d34eafd 100644
--- a/lisp/eshell/esh-mode.el
+++ b/lisp/eshell/esh-mode.el
@@ -877,9 +877,8 @@ If SCROLLBACK is non-nil, clear the scrollback contents."
(interactive)
(if scrollback
(eshell/clear-scrollback)
- (let ((number-newlines (count-lines (window-start) (point))))
- (insert (make-string number-newlines ?\n))
- (eshell-send-input))))
+ (insert (make-string (window-size) ?\n))
+ (eshell-send-input)))
(defun eshell/clear-scrollback ()
"Clear the scrollback content of the eshell window."