]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/tty/lib_mvcur.c
ncurses 6.2 - patch 20201017
[ncurses.git] / ncurses / tty / lib_mvcur.c
index 86e2fb183dbed34b02b36a7a87dd2573f4c1d6f8..c085ae140eac8ea4c9ac136b6e42ebaacdf1c80f 100644 (file)
 #define CUR SP_TERMTYPE
 #endif
 
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_mvcur.c,v 1.153 2020/05/27 23:56:32 tom Exp $")
+MODULE_ID("$Id: lib_mvcur.c,v 1.154 2020/10/03 20:25:48 tom Exp $")
 
 #define WANT_CHAR(sp, y, x) NewScreen(sp)->_line[y].text[x]    /* desired state */
 
 
 #define WANT_CHAR(sp, y, x) NewScreen(sp)->_line[y].text[x]    /* desired state */
 
@@ -577,7 +577,7 @@ relative_move(NCURSES_SP_DCLx
            }
 
            if (cursor_down
            }
 
            if (cursor_down
-               && (*cursor_down != '\n' || SP_PARM->_nl)
+               && (*cursor_down != '\n')
                && (n * SP_PARM->_cud1_cost < vcost)) {
                vcost = repeated_append(_nc_str_copy(target, &save), 0,
                                        SP_PARM->_cud1_cost, n, cursor_down);
                && (n * SP_PARM->_cud1_cost < vcost)) {
                vcost = repeated_append(_nc_str_copy(target, &save), 0,
                                        SP_PARM->_cud1_cost, n, cursor_down);
@@ -997,37 +997,28 @@ _nc_real_mvcur(NCURSES_SP_DCLx
 
        if (xold >= screen_columns(SP_PARM)) {
 
 
        if (xold >= screen_columns(SP_PARM)) {
 
-           if (SP_PARM->_nl) {
-               int l = (xold + 1) / screen_columns(SP_PARM);
+           int l = (xold + 1) / screen_columns(SP_PARM);
 
 
-               yold += l;
-               if (yold >= screen_lines(SP_PARM))
-                   l -= (yold - screen_lines(SP_PARM) - 1);
+           yold += l;
+           if (yold >= screen_lines(SP_PARM))
+               l -= (yold - screen_lines(SP_PARM) - 1);
 
 
-               if (l > 0) {
-                   if (carriage_return) {
-                       NCURSES_PUTP2("carriage_return", carriage_return);
-                   } else {
-                       myOutCh(NCURSES_SP_ARGx '\r');
-                   }
-                   xold = 0;
+           if (l > 0) {
+               if (carriage_return) {
+                   NCURSES_PUTP2("carriage_return", carriage_return);
+               } else {
+                   myOutCh(NCURSES_SP_ARGx '\r');
+               }
+               xold = 0;
 
 
-                   while (l > 0) {
-                       if (newline) {
-                           NCURSES_PUTP2("newline", newline);
-                       } else {
-                           myOutCh(NCURSES_SP_ARGx '\n');
-                       }
-                       l--;
+               while (l > 0) {
+                   if (newline) {
+                       NCURSES_PUTP2("newline", newline);
+                   } else {
+                       myOutCh(NCURSES_SP_ARGx '\n');
                    }
                    }
+                   l--;
                }
                }
-           } else {
-               /*
-                * If caller set nonl(), we cannot really use newlines to
-                * position to the next row.
-                */
-               xold = -1;
-               yold = -1;
            }
        }
 
            }
        }