Oops, remove debugging crap and don't be so conservative in space/tab check loop

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@560 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
Chris Allegretta 2001-03-14 10:17:39 +00:00
parent 74bb31b15a
commit 0b33d8864a

9
nano.c
View File

@ -768,7 +768,6 @@ void do_wrap(filestruct * inptr, char input_char)
/* Category 1a: one word taking up the whole line with no beginning spaces. */ /* Category 1a: one word taking up the whole line with no beginning spaces. */
if ((last_word_end == -1) && (!isspace((int) inptr->data[0]))) { if ((last_word_end == -1) && (!isspace((int) inptr->data[0]))) {
fprintf(stderr, "1a\n");
for (i = current_word_end; i < len; i++) { for (i = current_word_end; i < len; i++) {
if (!isspace((int) inptr->data[i]) && i < len) { if (!isspace((int) inptr->data[i]) && i < len) {
current_word_start = i; current_word_start = i;
@ -809,8 +808,7 @@ fprintf(stderr, "1a\n");
if (ISSET(AUTOINDENT)) { if (ISSET(AUTOINDENT)) {
int i = 0; int i = 0;
while ((inptr->next->data[i] == ' ' while ((inptr->next->data[i] == ' '
|| inptr->next->data[i] == '\t') || inptr->next->data[i] == '\t')) {
&& inptr->next->data[i] != 0) {
i++; i++;
right++; right++;
} }
@ -828,7 +826,6 @@ fprintf(stderr, "1a\n");
/* Category 2: two or more words on the line. */ /* Category 2: two or more words on the line. */
else { else {
fprintf(stderr, "2a\n");
/* Case 2a: cursor before word at wrap point. */ /* Case 2a: cursor before word at wrap point. */
if (current_x < current_word_start) { if (current_x < current_word_start) {
temp->data = temp->data =
@ -864,8 +861,7 @@ fprintf(stderr, "2a\n");
if (ISSET(AUTOINDENT)) { if (ISSET(AUTOINDENT)) {
int i = 0; int i = 0;
while ((inptr->next->data[i] == ' ' while ((inptr->next->data[i] == ' '
|| inptr->next->data[i] == '\t') || inptr->next->data[i] == '\t')) {
&& inptr->next->data[i] != 0) {
i++; i++;
right++; right++;
} }
@ -891,7 +887,6 @@ fprintf(stderr, "2a\n");
/* Case 2c: cursor past word at wrap point. */ /* Case 2c: cursor past word at wrap point. */
else { else {
fprintf(stderr, "2c\n");
temp->data = temp->data =
nmalloc(strlen(&inptr->data[current_word_start]) + 1); nmalloc(strlen(&inptr->data[current_word_start]) + 1);
strcpy(temp->data, &inptr->data[current_word_start]); strcpy(temp->data, &inptr->data[current_word_start]);