function ncalloc(), will have to go through source code later
and change the aproproate calls which used nmalloc for lack of
an apropriate calloc function *** FIXME ***
+ - After "Alternate" spell checker is called, cursor is repositioned on
+ the same line as before ^T was called.
- configure.in:
- New option, --enable-nanorc which currently does nothing but
sets a define. Will do more later...
- global.c:
- Updated some of the lists for the "Goto Directory" code (Rocco)
- nano.c:
+ do_alt_speller()
+ - Reposition cursor on same line as before ^T was called (Rocco)
main()
- Code to silently process "-g" and "-j" (Rocco)
- nano.h:
- Updated the BROWSER_LIST_LEN for the "Goto Directory" code (Rocco)
- proto.h:
- New shortcut list added: gotodir_list (Rocco).
+- search.c:
+ do_gotoline()
+ - Optimizations, remove "$" goes-to-last-line, less messages (Rocco)
nano 1.1 tree forked here 04/07/2001
int alt_spell_status;
pid_t pid_spell;
char *ptr;
+ long lineno_cur = current->lineno;
static int arglen = 3;
static char **spellargs = (char **) NULL;
free_filestruct(fileage);
global_init();
open_file(file_name, 0, 1);
- edit_update(fileage, CENTER);
- display_main_list();
+
+ do_gotoline(lineno_cur);
set_modified();
return TRUE;
display_main_list();
}
-int do_gotoline(long defline)
+int do_gotoline(long line)
{
- long line, i = 1, j = 0;
- filestruct *fileptr;
+ long i = 1;
+
+ if (line <= 0) { /* Ask for it */
- if (defline > 0) /* We already know what line we want to go to */
- line = defline;
- else { /* Ask for it */
+ long j = 0;
j = statusq(0, goto_list, GOTO_LIST_LEN, "", _("Enter line number"));
- if (j == -1) {
+ if (j != 0) {
statusbar(_("Aborted"));
goto_abort();
return 0;
- } else if (j != 0) {
- do_early_abort();
- goto_abort();
- return 0;
}
- if (!strcmp(answer, "$")) {
- current = filebot;
- current_x = 0;
- edit_update(current, CENTER);
+
+ line = atoi(answer);
+
+ /* Bounds check */
+ if (line <= 0) {
+ statusbar(_("Come on, be reasonable"));
goto_abort();
- return 1;
+ return 0;
}
- line = atoi(answer);
}
- /* Bounds check */
- if (line <= 0) {
- statusbar(_("Come on, be reasonable"));
- goto_abort();
- return 0;
- }
- if (line > totlines) {
- statusbar(_("Only %d lines available, skipping to last line"),
- filebot->lineno);
- current = filebot;
- current_x = 0;
- edit_update(current, CENTER);
- } else {
- for (fileptr = fileage; fileptr != NULL && i < line; i++)
- fileptr = fileptr->next;
+ for (current = fileage; ((current->next != NULL) && (i < line)); i++)
+ current = current->next;
- current = fileptr;
- current_x = 0;
- edit_update(current, CENTER);
- }
+ current_x = 0;
+ edit_update(current, CENTER);
goto_abort();
return 1;