decode.c (63128) | decode.c (89019) |
---|---|
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. --- 126 unchanged lines hidden (view full) --- 135 'm',0, A_SETMARK, 136 '\'',0, A_GOMARK, 137 CONTROL('X'),CONTROL('X'),0, A_GOMARK, 138 'E',0, A_EXAMINE, 139 ':','e',0, A_EXAMINE, 140 CONTROL('X'),CONTROL('V'),0, A_EXAMINE, 141 ':','n',0, A_NEXT_FILE, 142 ':','p',0, A_PREV_FILE, | 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. --- 126 unchanged lines hidden (view full) --- 135 'm',0, A_SETMARK, 136 '\'',0, A_GOMARK, 137 CONTROL('X'),CONTROL('X'),0, A_GOMARK, 138 'E',0, A_EXAMINE, 139 ':','e',0, A_EXAMINE, 140 CONTROL('X'),CONTROL('V'),0, A_EXAMINE, 141 ':','n',0, A_NEXT_FILE, 142 ':','p',0, A_PREV_FILE, |
143 't',0, A_NEXT_TAG, 144 'T',0, A_PREV_TAG, |
|
143 ':','x',0, A_INDEX_FILE, 144 ':','d',0, A_REMOVE_FILE, 145 '-',0, A_OPT_TOGGLE, 146 ':','t',0, A_OPT_TOGGLE|A_EXTRA, 't',0, 147 's',0, A_OPT_TOGGLE|A_EXTRA, 'o',0, 148 '_',0, A_DISP_OPTION, 149 '|',0, A_PIPE, 150 'v',0, A_VISUAL, --- 137 unchanged lines hidden (view full) --- 288{ 289 /* 290 * Add the default command tables. 291 */ 292 add_fcmd_table((char*)cmdtable, sizeof(cmdtable)); 293 add_ecmd_table((char*)edittable, sizeof(edittable)); 294#if USERFILE 295 /* | 145 ':','x',0, A_INDEX_FILE, 146 ':','d',0, A_REMOVE_FILE, 147 '-',0, A_OPT_TOGGLE, 148 ':','t',0, A_OPT_TOGGLE|A_EXTRA, 't',0, 149 's',0, A_OPT_TOGGLE|A_EXTRA, 'o',0, 150 '_',0, A_DISP_OPTION, 151 '|',0, A_PIPE, 152 'v',0, A_VISUAL, --- 137 unchanged lines hidden (view full) --- 290{ 291 /* 292 * Add the default command tables. 293 */ 294 add_fcmd_table((char*)cmdtable, sizeof(cmdtable)); 295 add_ecmd_table((char*)edittable, sizeof(edittable)); 296#if USERFILE 297 /* |
298 * For backwards compatibility, 299 * try to add tables in the OLD system lesskey file. 300 */ 301#ifdef BINDIR 302 add_hometable(NULL, BINDIR "/.sysless", 1); 303#endif 304 /* |
|
296 * Try to add the tables in the system lesskey file. 297 */ 298 add_hometable("LESSKEY_SYSTEM", LESSKEYFILE_SYS, 1); 299 /* 300 * Try to add the tables in the standard lesskey file "$HOME/.less". 301 */ 302 add_hometable("LESSKEY", LESSKEYFILE, 0); 303#endif --- 399 unchanged lines hidden (view full) --- 703add_hometable(envname, def_filename, sysvar) 704 char *envname; 705 char *def_filename; 706 int sysvar; 707{ 708 char *filename; 709 PARG parg; 710 | 305 * Try to add the tables in the system lesskey file. 306 */ 307 add_hometable("LESSKEY_SYSTEM", LESSKEYFILE_SYS, 1); 308 /* 309 * Try to add the tables in the standard lesskey file "$HOME/.less". 310 */ 311 add_hometable("LESSKEY", LESSKEYFILE, 0); 312#endif --- 399 unchanged lines hidden (view full) --- 712add_hometable(envname, def_filename, sysvar) 713 char *envname; 714 char *def_filename; 715 int sysvar; 716{ 717 char *filename; 718 PARG parg; 719 |
711 if ((filename = lgetenv(envname)) != NULL) | 720 if (envname != NULL && (filename = lgetenv(envname)) != NULL) |
712 filename = save(filename); 713 else if (sysvar) 714 filename = save(def_filename); 715 else 716 filename = homefile(def_filename); 717 if (filename == NULL) 718 return; 719 if (lesskey(filename, sysvar) < 0) --- 39 unchanged lines hidden (view full) --- 759 if (nch > 0) 760 c = getcc(); 761 usercmd[nch] = c; 762 usercmd[nch+1] = '\0'; 763 nch++; 764 action = ecmd_decode(usercmd, &s); 765 } while (action == A_PREFIX); 766 | 721 filename = save(filename); 722 else if (sysvar) 723 filename = save(def_filename); 724 else 725 filename = homefile(def_filename); 726 if (filename == NULL) 727 return; 728 if (lesskey(filename, sysvar) < 0) --- 39 unchanged lines hidden (view full) --- 768 if (nch > 0) 769 c = getcc(); 770 usercmd[nch] = c; 771 usercmd[nch+1] = '\0'; 772 nch++; 773 action = ecmd_decode(usercmd, &s); 774 } while (action == A_PREFIX); 775 |
776 if (flags & EC_NORIGHTLEFT) 777 { 778 switch (action) 779 { 780 case EC_RIGHT: 781 case EC_LEFT: 782 action = A_INVALID; 783 break; 784 } 785 } |
|
767#if CMD_HISTORY 768 if (flags & EC_NOHISTORY) 769 { 770 /* 771 * The caller says there is no history list. 772 * Reject any history-manipulation action. 773 */ 774 switch (action) --- 45 unchanged lines hidden --- | 786#if CMD_HISTORY 787 if (flags & EC_NOHISTORY) 788 { 789 /* 790 * The caller says there is no history list. 791 * Reject any history-manipulation action. 792 */ 793 switch (action) --- 45 unchanged lines hidden --- |