[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: M-x term off-by-one problem in ESC[xM processing?
From: |
Mark Plaksin |
Subject: |
Re: M-x term off-by-one problem in ESC[xM processing? |
Date: |
Tue, 13 Jun 2006 16:39:22 -0400 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.51 (gnu/linux) |
Mark Plaksin <address@hidden> writes:
> Mark Plaksin <address@hidden> writes:
>
>> Hiho:
>>
>> - Save the attached file as 'testfile'
>> - Create a 125x23 M-x term window (same problem with 80x23) .
>> - At the shell prompt, run 'vi testfile' with the attached file
>> - Type C-d to tell vi to scroll down
>> - The first line will contain "12" and you'll see that the line for "22" is
>> blank. That blank line is the problem.
>>
>> The problem seems to be in term-delete-lines (or the argument passed to it
>> from the `M' case of term-handle-ansi-escape). In edebug these lines from
>> term-delete-lines move point down one too few lines and then insert a
>> newline which wipes out "22":
>>
>> (term-down (- term-scroll-end save-current-row lines))
>> (term-insert-char ?\n lines)
>
> Adding '(forward-line 1)' after those two lines fixes the test case for me
> but I'm not sure whether it's the right fix.
term-insert-lines seems to have a similar problem. You can use the same
test case as above but play with vi's C-u instead of C-d. Adding
'(forward-line 1)' after these lines fixes it for me:
(when (>= (+ save-current-row lines) term-scroll-end)
(setq lines (- lines (- (+ save-current-row lines) term-scroll-end))))
(term-down (- term-scroll-end save-current-row lines)))
Again, it's not clear to me that this is the right fix. If all my M-x term
problems go away then maybe it :) It will take me a week or so to see
whether my problems are gone.