command.c (a8f92a7ce5678c7ac2c635f123aea79b13ba8dd7) | command.c (8ed69c6ff9a57551420d2cb6f67c989b37477cb5) |
---|---|
1/* $FreeBSD$ */ | |
2/* 3 * Copyright (C) 1984-2000 Mark Nudelman 4 * 5 * You may distribute under the terms of either the GNU General Public 6 * License or the Less License, as specified in the README file. 7 * 8 * For more information about less, or for information on how to 9 * contact the author, see the README file. --- 21 unchanged lines hidden (view full) --- 31extern int jump_sline; 32extern int quitting; 33extern int wscroll; 34extern int top_scroll; 35extern int ignore_eoi; 36extern int secure; 37extern int hshift; 38extern int show_attn; | 1/* 2 * Copyright (C) 1984-2000 Mark Nudelman 3 * 4 * You may distribute under the terms of either the GNU General Public 5 * License or the Less License, as specified in the README file. 6 * 7 * For more information about less, or for information on how to 8 * contact the author, see the README file. --- 21 unchanged lines hidden (view full) --- 30extern int jump_sline; 31extern int quitting; 32extern int wscroll; 33extern int top_scroll; 34extern int ignore_eoi; 35extern int secure; 36extern int hshift; 37extern int show_attn; |
39extern int more_mode; | |
40extern char *every_first_cmd; 41extern char *curr_altfilename; 42extern char version[]; 43extern struct scrpos initial_scrpos; 44extern IFILE curr_ifile; 45extern void constant *ml_search; 46extern void constant *ml_examine; 47#if SHELL_ESCAPE || PIPEC 48extern void constant *ml_shell; 49#endif 50#if EDITOR 51extern char *editor; 52extern char *editproto; 53#endif 54extern int screen_trashed; /* The screen has been overwritten */ | 38extern char *every_first_cmd; 39extern char *curr_altfilename; 40extern char version[]; 41extern struct scrpos initial_scrpos; 42extern IFILE curr_ifile; 43extern void constant *ml_search; 44extern void constant *ml_examine; 45#if SHELL_ESCAPE || PIPEC 46extern void constant *ml_shell; 47#endif 48#if EDITOR 49extern char *editor; 50extern char *editproto; 51#endif 52extern int screen_trashed; /* The screen has been overwritten */ |
53extern int shift_count; |
|
55 56static char ungot[UNGOT_SIZE]; 57static char *ungotp = NULL; 58#if SHELL_ESCAPE 59static char *shellcmd = NULL; /* For holding last shell command for "!!" */ 60#endif 61static int mca; /* The multicharacter command (action) */ 62static int search_type; /* The previous type of search */ --- 402 unchanged lines hidden (view full) --- 465 /* 466 * Only works for the first char of the pattern. 467 */ 468 break; 469 470 flag = 0; 471 switch (c) 472 { | 54 55static char ungot[UNGOT_SIZE]; 56static char *ungotp = NULL; 57#if SHELL_ESCAPE 58static char *shellcmd = NULL; /* For holding last shell command for "!!" */ 59#endif 60static int mca; /* The multicharacter command (action) */ 61static int search_type; /* The previous type of search */ --- 402 unchanged lines hidden (view full) --- 464 /* 465 * Only works for the first char of the pattern. 466 */ 467 break; 468 469 flag = 0; 470 switch (c) 471 { |
473 case '*': 474 if (more_mode) 475 break; | |
476 case CONTROL('E'): /* ignore END of file */ | 472 case CONTROL('E'): /* ignore END of file */ |
473 case '*': |
|
477 flag = SRCH_PAST_EOF; 478 break; | 474 flag = SRCH_PAST_EOF; 475 break; |
479 case '@': 480 if (more_mode) 481 break; | |
482 case CONTROL('F'): /* FIRST file */ | 476 case CONTROL('F'): /* FIRST file */ |
477 case '@': |
|
483 flag = SRCH_FIRST_FILE; 484 break; 485 case CONTROL('K'): /* KEEP position */ 486 flag = SRCH_NO_MOVE; 487 break; 488 case CONTROL('R'): /* Don't use REGULAR EXPRESSIONS */ 489 flag = SRCH_NO_REGEX; 490 break; --- 1012 unchanged lines hidden (view full) --- 1503 case A_B_BRACKET: 1504 case A_F_BRACKET: 1505 start_mca(action, "Brackets: ", (void*)NULL, 0); 1506 c = getcc(); 1507 goto again; 1508 1509 case A_LSHIFT: 1510 if (number <= 0) | 478 flag = SRCH_FIRST_FILE; 479 break; 480 case CONTROL('K'): /* KEEP position */ 481 flag = SRCH_NO_MOVE; 482 break; 483 case CONTROL('R'): /* Don't use REGULAR EXPRESSIONS */ 484 flag = SRCH_NO_REGEX; 485 break; --- 1012 unchanged lines hidden (view full) --- 1498 case A_B_BRACKET: 1499 case A_F_BRACKET: 1500 start_mca(action, "Brackets: ", (void*)NULL, 0); 1501 c = getcc(); 1502 goto again; 1503 1504 case A_LSHIFT: 1505 if (number <= 0) |
1511 number = 8; | 1506 number = (shift_count > 0) ? 1507 shift_count : sc_width / 2; |
1512 if (number > hshift) 1513 number = hshift; 1514 hshift -= number; 1515 screen_trashed = 1; 1516 break; 1517 1518 case A_RSHIFT: 1519 if (number <= 0) | 1508 if (number > hshift) 1509 number = hshift; 1510 hshift -= number; 1511 screen_trashed = 1; 1512 break; 1513 1514 case A_RSHIFT: 1515 if (number <= 0) |
1520 number = 8; | 1516 number = (shift_count > 0) ? 1517 shift_count : sc_width / 2; |
1521 hshift += number; 1522 screen_trashed = 1; 1523 break; 1524 1525 case A_PREFIX: 1526 /* 1527 * The command is incomplete (more chars are needed). 1528 * Display the current char, so the user knows --- 21 unchanged lines hidden --- | 1518 hshift += number; 1519 screen_trashed = 1; 1520 break; 1521 1522 case A_PREFIX: 1523 /* 1524 * The command is incomplete (more chars are needed). 1525 * Display the current char, so the user knows --- 21 unchanged lines hidden --- |