aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/msdos.c33
1 files changed, 28 insertions, 5 deletions
diff --git a/src/msdos.c b/src/msdos.c
index 42374ad3657..fc9d3e29925 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -771,15 +771,38 @@ IT_cmgoto (FRAME_PTR f)
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;
787
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 }
781 804
782 if (current_pos_X > tem_X) 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;