diff options
| author | Noam Postavsky | 2018-03-11 20:47:12 -0400 |
|---|---|---|
| committer | Noam Postavsky | 2018-03-13 21:58:38 -0400 |
| commit | 4c33ad4a244db59bfe128aa54380904efdc775ba (patch) | |
| tree | 95211f134f4c33187a4a9344b13dda2db93d0c8b /test | |
| parent | e0f18aa07fb900c1bb0fe25386336fd6a73c9b0d (diff) | |
| download | emacs-4c33ad4a244db59bfe128aa54380904efdc775ba.tar.gz emacs-4c33ad4a244db59bfe128aa54380904efdc775ba.zip | |
Fix line-wrapping for term.el (Bug#30775)
* lisp/term.el (term-emulate-terminal): Leave line-wrapping state if
point was moved after we entered it.
* test/lisp/term-tests.el (term-line-wrapping-then-motion): New test.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/term-tests.el | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/lisp/term-tests.el b/test/lisp/term-tests.el index 234dfa1f0d5..8aaa61a210b 100644 --- a/test/lisp/term-tests.el +++ b/test/lisp/term-tests.el | |||
| @@ -124,6 +124,18 @@ line6\r | |||
| 124 | 40 12 (list "\eAnSiTc /f" "oo/\n") 'default-directory) | 124 | 40 12 (list "\eAnSiTc /f" "oo/\n") 'default-directory) |
| 125 | "/foo/")))) | 125 | "/foo/")))) |
| 126 | 126 | ||
| 127 | (ert-deftest term-line-wrapping-then-motion () | ||
| 128 | "Make sure we reset the line-wrapping state after moving cursor. | ||
| 129 | A real-life example is the default zsh prompt which writes spaces | ||
| 130 | to the end of line (triggering line-wrapping state), and then | ||
| 131 | sends a carriage return followed by another space to overwrite | ||
| 132 | the first character of the line." | ||
| 133 | (let* ((width 10) | ||
| 134 | (strs (list "x" (make-string (1- width) ?_) | ||
| 135 | "\r_"))) | ||
| 136 | (should (equal (term-test-screen-from-input width 12 strs) | ||
| 137 | (make-string width ?_))))) | ||
| 138 | |||
| 127 | (provide 'term-tests) | 139 | (provide 'term-tests) |
| 128 | 140 | ||
| 129 | ;;; term-tests.el ends here | 141 | ;;; term-tests.el ends here |