mirror of git://git.sv.gnu.org/nano.git
Back out do_prev_word and SMALL changes, as the prev function is obviously not stable enough
git-svn-id: svn://svn.savannah.gnu.org/nano/branches/nano_1_0_branch/nano@883 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
parent
ff12e95da0
commit
5beded351c
|
@ -10,10 +10,6 @@ CVS code -
|
|||
cut_marked_segment()
|
||||
- Fix off-by one in mem allocation.
|
||||
- nano.c:
|
||||
- Backported do_prev_word() from 1.1. Allows alt-space to
|
||||
move to the previous word in the file.
|
||||
- Added #ifdef NANO_SMALL around do_next_space and do_prev_space
|
||||
codes, as nano-tiny doesn't particularly need those features.
|
||||
main()
|
||||
- Ignore 26 (control-]) (bug discovered by David Lawrence Ramsey)
|
||||
- nano.texi:
|
||||
|
|
82
nano.c
82
nano.c
|
@ -649,7 +649,6 @@ int do_enter_void(void)
|
|||
return do_enter(current);
|
||||
}
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
void do_next_word(void)
|
||||
{
|
||||
filestruct *fileptr, *old;
|
||||
|
@ -701,78 +700,6 @@ void do_next_word(void)
|
|||
}
|
||||
}
|
||||
|
||||
/* the same thing for backwards */
|
||||
void do_prev_word(void)
|
||||
{
|
||||
filestruct *fileptr, *old;
|
||||
int i;
|
||||
|
||||
if (current == NULL)
|
||||
return;
|
||||
|
||||
old = current;
|
||||
i = current_x;
|
||||
for (fileptr = current; fileptr != NULL; fileptr = fileptr->prev) {
|
||||
if (fileptr == current) {
|
||||
while (isalnum((int) fileptr->data[i])
|
||||
&& i != 0)
|
||||
i--;
|
||||
|
||||
if (i == 0) {
|
||||
if (fileptr->prev != NULL)
|
||||
i = strlen(fileptr->prev->data) - 1;
|
||||
else if (fileptr == fileage && filebot != NULL) {
|
||||
current_x = 0;
|
||||
return;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
while (!isalnum((int) fileptr->data[i]) && i != 0)
|
||||
i--;
|
||||
|
||||
if (i > 0) {
|
||||
i--;
|
||||
|
||||
while (isalnum((int) fileptr->data[i]) && i != 0)
|
||||
i--;
|
||||
|
||||
i++;
|
||||
if (i != 0)
|
||||
break;
|
||||
|
||||
}
|
||||
if (fileptr->prev != NULL)
|
||||
i = strlen(fileptr->prev->data) - 1;
|
||||
else if (fileptr == fileage && filebot != NULL) {
|
||||
current_x = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (fileptr == NULL)
|
||||
current = fileage;
|
||||
else
|
||||
current = fileptr;
|
||||
|
||||
current_x = i;
|
||||
placewewant = xplustabs();
|
||||
|
||||
if (current->lineno <= edittop->lineno)
|
||||
edit_update(current, CENTER);
|
||||
else {
|
||||
/* If we've jumped lines, refresh the old line. We can't just use
|
||||
* current->prev here, because we may have skipped over some blank
|
||||
* lines, in which case the previous line is the wrong one.
|
||||
*/
|
||||
if (current != old)
|
||||
update_line(old, 0);
|
||||
|
||||
update_line(current, current_x);
|
||||
}
|
||||
}
|
||||
#endif /* NANO_SMALL */
|
||||
|
||||
#ifndef DISABLE_WRAPPING
|
||||
void do_wrap(filestruct * inptr, char input_char)
|
||||
{
|
||||
|
@ -2537,13 +2464,6 @@ int main(int argc, char *argv[])
|
|||
modify_control_seq = 1;
|
||||
keyhandled = 1;
|
||||
break;
|
||||
#ifndef NANO_SMALL
|
||||
case ' ':
|
||||
/* If control-space is next word, Alt-space should be previous word */
|
||||
do_prev_word();
|
||||
keyhandled = 1;
|
||||
break;
|
||||
#endif
|
||||
case 91:
|
||||
switch (kbinput = wgetch(edit)) {
|
||||
case '1': /* Alt-[-1-[0-5,7-9] = F1-F8 in X at least */
|
||||
|
@ -2726,10 +2646,8 @@ int main(int argc, char *argv[])
|
|||
#endif
|
||||
#endif
|
||||
case 0: /* Erg */
|
||||
#ifndef NANO_SMALL
|
||||
do_next_word();
|
||||
break;
|
||||
#endif
|
||||
|
||||
case 331: /* Stuff that we don't want to do squat */
|
||||
case -1:
|
||||
|
|
Loading…
Reference in New Issue