diff options
Diffstat (limited to 'src/cm.c')
| -rw-r--r-- | src/cm.c | 22 |
1 files changed, 11 insertions, 11 deletions
| @@ -83,9 +83,9 @@ cmputc (c) | |||
| 83 | */ | 83 | */ |
| 84 | 84 | ||
| 85 | static | 85 | static |
| 86 | at (row, col) { | 86 | at (tty, row, col) { |
| 87 | curY = row; | 87 | curY (tty) = row; |
| 88 | curX = col; | 88 | curX (tty) = col; |
| 89 | } | 89 | } |
| 90 | 90 | ||
| 91 | /* | 91 | /* |
| @@ -93,8 +93,8 @@ at (row, col) { | |||
| 93 | */ | 93 | */ |
| 94 | 94 | ||
| 95 | static | 95 | static |
| 96 | addcol (n) { | 96 | addcol (tty, n) { |
| 97 | curX += n; | 97 | curX (tty) += n; |
| 98 | 98 | ||
| 99 | /* | 99 | /* |
| 100 | * If cursor hit edge of screen, what happened? | 100 | * If cursor hit edge of screen, what happened? |
| @@ -104,21 +104,21 @@ addcol (n) { | |||
| 104 | * of the last line. | 104 | * of the last line. |
| 105 | */ | 105 | */ |
| 106 | 106 | ||
| 107 | if (curX == Wcm.cm_cols) { | 107 | if (curX (tty) == tty->Wcm->cm_cols) { |
| 108 | /* | 108 | /* |
| 109 | * Well, if magicwrap, still there, past the edge of the | 109 | * Well, if magicwrap, still there, past the edge of the |
| 110 | * screen (!). If autowrap, on the col 0 of the next line. | 110 | * screen (!). If autowrap, on the col 0 of the next line. |
| 111 | * Otherwise on last column. | 111 | * Otherwise on last column. |
| 112 | */ | 112 | */ |
| 113 | 113 | ||
| 114 | if (Wcm.cm_magicwrap) | 114 | if (tty->Wcm->cm_magicwrap) |
| 115 | ; /* "limbo" */ | 115 | ; /* "limbo" */ |
| 116 | else if (Wcm.cm_autowrap) { | 116 | else if (tty->Wcm->cm_autowrap) { |
| 117 | curX = 0; | 117 | curX (tty) = 0; |
| 118 | curY++; /* Beware end of screen! */ | 118 | curY (tty) ++; /* Beware end of screen! */ |
| 119 | } | 119 | } |
| 120 | else | 120 | else |
| 121 | curX--; | 121 | curX (tty)--; |
| 122 | } | 122 | } |
| 123 | } | 123 | } |
| 124 | #endif | 124 | #endif |