Mercurial > emacs
comparison src/msdos.c @ 23156:e080ad3cc739
(IT_cmgoto): When tracking echo area messages with the
cursor, save and restore previous cursor position in the
minibuffer.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Mon, 31 Aug 1998 15:56:52 +0000 |
parents | fe3128dafc96 |
children | eee76d0af99c |
comparison
equal
deleted
inserted
replaced
23155:8d75946934cf | 23156:e080ad3cc739 |
---|---|
769 IT_cmgoto (FRAME_PTR f) | 769 IT_cmgoto (FRAME_PTR f) |
770 { | 770 { |
771 /* Only set the cursor to where it should be if the display is | 771 /* Only set the cursor to where it should be if the display is |
772 already in sync with the window contents. */ | 772 already in sync with the window contents. */ |
773 int update_cursor_pos = MODIFF == unchanged_modified; | 773 int update_cursor_pos = MODIFF == unchanged_modified; |
774 | 774 static int previous_pos_X = -1; |
775 /* If we are in the echo area, and the cursor is beyond the end of | 775 |
776 the text, put the cursor at the end of text. */ | 776 /* If the display is in sync, forget any previous knowledge about |
777 cursor position. This is primarily for unexpected events like | |
778 C-g in the minibuffer. */ | |
779 if (update_cursor_pos && previous_pos_X >= 0) | |
780 previous_pos_X = -1; | |
781 /* If we are in the echo area, put the cursor at the | |
782 end of the echo area message. */ | |
777 if (!update_cursor_pos | 783 if (!update_cursor_pos |
778 && XFASTINT (XWINDOW (FRAME_MINIBUF_WINDOW (f))->top) <= new_pos_Y) | 784 && XFASTINT (XWINDOW (FRAME_MINIBUF_WINDOW (f))->top) <= new_pos_Y) |
779 { | 785 { |
780 int tem_X = FRAME_DESIRED_GLYPHS (f)->used[new_pos_Y]; | 786 int tem_X = current_pos_X, dummy; |
781 | 787 |
782 if (current_pos_X > tem_X) | 788 if (echo_area_glyphs) |
789 { | |
790 tem_X = echo_area_glyphs_length; | |
791 /* Save current cursor position, to be restored after the | |
792 echo area message is erased. Only remember one level | |
793 of previous cursor position. */ | |
794 if (previous_pos_X == -1) | |
795 ScreenGetCursor (&dummy, &previous_pos_X); | |
796 } | |
797 else if (previous_pos_X >= 0) | |
798 { | |
799 /* We wind up here after the echo area message is erased. | |
800 Restore the cursor position we remembered above. */ | |
801 tem_X = previous_pos_X; | |
802 previous_pos_X = -1; | |
803 } | |
804 | |
805 if (current_pos_X != tem_X) | |
783 { | 806 { |
784 new_pos_X = tem_X; | 807 new_pos_X = tem_X; |
785 update_cursor_pos = 1; | 808 update_cursor_pos = 1; |
786 } | 809 } |
787 } | 810 } |