Changeset 22052 for trunk/src/kernel32/conin.cpp
- Timestamp:
- Dec 30, 2012, 1:02:33 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/conin.cpp
r10471 r22052 221 221 if (ulCounter > 0) 222 222 { 223 //@@@PH erase character on screen!224 223 ulCounter--; 225 224 pszTarget--; 226 225 /* local echo enabled ? */ 227 226 if (pConsoleInput->dwConsoleMode & ENABLE_ECHO_INPUT) 227 { 228 ULONG repeat = 1; 229 if (*pszTarget == 0x09) // tab 230 { 231 // detect the expanded width of the deleted tab 232 ULONG cnt = 0; 233 PSZ psz = (PSZ)lpBuffer; 234 ULONG p = 0, ulTabSize = pConsoleGlobals->Options.ulTabSize; 235 for (; cnt < ulCounter; cnt++, psz++) 236 { 237 if (*psz == 0x09) 238 p += ulTabSize - p % ulTabSize; 239 else 240 { 241 if (*psz == 0x0d && cnt < ulCounter && *(psz + 1) == 0x0a) 242 psz++; 243 p++; 244 } 245 } 246 // this will give us the expanded width 247 repeat = ulTabSize - p % ulTabSize; 248 249 } 250 while (repeat--) 251 HMWriteFile(pConsoleGlobals->hConsoleBuffer, 252 &InputRecord.Event.KeyEvent.uChar.AsciiChar, 253 1, 254 &ulPostCounter, /* dummy result */ 255 NULL, NULL); 256 } 257 } 258 break; 259 260 case 0x09: // tab 261 /* local echo enabled ? */ 262 if (pConsoleInput->dwConsoleMode & ENABLE_ECHO_INPUT) 263 { 264 // expand tabs (not rely on HMWriteFile since we calculate tabs from the 265 // beginning of the whole buffer, not the current line) 266 ULONG repeat = 1; 267 // detect the expanded width of the new tab 268 ULONG cnt = 0; 269 PSZ psz = (PSZ)lpBuffer; 270 ULONG p = 0, ulTabSize = pConsoleGlobals->Options.ulTabSize; 271 for (; cnt < ulCounter; cnt++, psz++) 272 { 273 if (*psz == 0x09) 274 p += ulTabSize - p % ulTabSize; 275 else 276 { 277 if (*psz == 0x0d && cnt < ulCounter && *(psz + 1) == 0x0a) 278 psz++; 279 p++; 280 } 281 } 282 // this will give us the expanded width 283 repeat = ulTabSize - p % ulTabSize; 284 285 while (repeat--) 228 286 HMWriteFile(pConsoleGlobals->hConsoleBuffer, 229 &InputRecord.Event.KeyEvent.uChar.AsciiChar,287 " ", 230 288 1, 231 289 &ulPostCounter, /* dummy result */ 232 290 NULL, NULL); 233 291 } 292 293 *pszTarget = InputRecord.Event.KeyEvent.uChar.AsciiChar; 294 pszTarget++; 295 ulCounter++; 234 296 break; 235 297
Note:
See TracChangeset
for help on using the changeset viewer.