To: vim-dev@vim.org Subject: Patch 6.0.073 (extra) Fcc: outbox From: Bram Moolenaar MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.0.073 (extra) Problem: DJGPP: When using CTRL-Z to start a shell, the prompt is halfway the text. (Volker Kiefel) Solution: Position the system cursor before starting the shell. Files: src/os_msdos.c *** ../vim60.72/src/os_msdos.c Sun Sep 16 17:17:36 2001 --- src/os_msdos.c Sun Nov 4 19:28:43 2001 *************** *** 115,126 **** --- 115,148 ---- int S_iBufferColumn; static void + myflush(void) + { + if (S_linebufferpos != S_linebuffer) + { + _dosmemputw(S_linebuffer, (S_linebufferpos - S_linebuffer), + S_ulScreenBase + + S_iBufferRow * (Columns << 1) + (S_iBufferColumn << 1)); + S_linebufferpos = S_linebuffer; + } + } + + static void mygotoxy(int x, int y) { S_iCurrentRow = y - 1; S_iCurrentColumn = x - 1; } + /* + * Set the system cursor to our cursor position. + */ + static void + set_sys_cursor(void) + { + myflush(); + gotoxy(S_iCurrentColumn + 1, S_iCurrentRow + 1); + } + static void setblankbuffer(unsigned short uiValue) { *************** *** 222,239 **** + (S_iBottom - 1) * (Columns << 1) + iColumn); } - static void - myflush(void) - { - if (S_linebufferpos != S_linebuffer) - { - _dosmemputw(S_linebuffer, (S_linebufferpos - S_linebuffer), - S_ulScreenBase - + S_iBufferRow * (Columns << 1) + (S_iBufferColumn << 1)); - S_linebufferpos = S_linebuffer; - } - } - static int myputch(int iChar) { --- 244,249 ---- *************** *** 1007,1014 **** show_mouse(TRUE); #endif #ifdef DJGPP ! myflush(); ! gotoxy(S_iCurrentColumn + 1, S_iCurrentRow + 1); #endif if (time >= 0) { --- 1017,1023 ---- show_mouse(TRUE); #endif #ifdef DJGPP ! set_sys_cursor(); #endif if (time >= 0) { *************** *** 1895,1903 **** stoptermcap(); set_interrupts(FALSE); /* restore interrupts */ #ifdef DJGPP ! /* Let the system know where our cursor is. */ ! myflush(); ! gotoxy(S_iCurrentColumn + 1, S_iCurrentRow + 1); #endif /* Somehow outputting CR-NL causes the original colors to be restored */ out_char('\r'); --- 1904,1910 ---- stoptermcap(); set_interrupts(FALSE); /* restore interrupts */ #ifdef DJGPP ! set_sys_cursor(); #endif /* Somehow outputting CR-NL causes the original colors to be restored */ out_char('\r'); *************** *** 2102,2107 **** --- 2109,2117 ---- #endif out_flush(); + #ifdef DJGPP + set_sys_cursor(); + #endif if (options & SHELL_COOKED) settmode(TMODE_COOK); /* set to normal mode */ *** ../vim60.72/src/version.c Sun Nov 4 19:10:16 2001 --- src/version.c Sun Nov 4 19:32:16 2001 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 73, /**/ -- Engineers are widely recognized as superior marriage material: intelligent, dependable, employed, honest, and handy around the house. (Scott Adams - The Dilbert principle) /// Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net \\\ ((( Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim ))) \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///