2000-08-06 21:13:45 +00:00
|
|
|
/* $Id$ */
|
2000-06-06 05:53:49 +00:00
|
|
|
/**************************************************************************
|
|
|
|
* global.c *
|
|
|
|
* *
|
2003-01-15 19:33:27 +00:00
|
|
|
* Copyright (C) 1999-2003 Chris Allegretta *
|
2000-06-06 05:53:49 +00:00
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
2001-10-24 11:33:54 +00:00
|
|
|
* the Free Software Foundation; either version 2, or (at your option) *
|
2000-06-06 05:53:49 +00:00
|
|
|
* any later version. *
|
|
|
|
* *
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU General Public License *
|
|
|
|
* along with this program; if not, write to the Free Software *
|
|
|
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
|
|
|
|
* *
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
|
|
#include "config.h"
|
2001-04-28 18:03:52 +00:00
|
|
|
|
2002-10-13 18:43:45 +00:00
|
|
|
#include <stdlib.h>
|
2002-04-23 10:56:06 +00:00
|
|
|
#include <assert.h>
|
2001-04-28 18:03:52 +00:00
|
|
|
#include <sys/stat.h>
|
2000-06-06 05:53:49 +00:00
|
|
|
#include "proto.h"
|
2002-06-13 00:40:19 +00:00
|
|
|
#include "nano.h"
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2003-01-13 01:35:15 +00:00
|
|
|
/* Global variables */
|
2002-02-22 04:30:50 +00:00
|
|
|
|
2002-07-19 01:08:59 +00:00
|
|
|
/* wrap_at might be set in rcfile.c or nano.c */
|
|
|
|
int wrap_at = -CHARS_FROM_EOL;/* Right justified fill value, allows resize */
|
|
|
|
char *last_search = NULL; /* Last string we searched for */
|
|
|
|
char *last_replace = NULL; /* Last replacement string */
|
|
|
|
int search_last_line; /* Is this the last search line? */
|
2003-01-13 01:35:15 +00:00
|
|
|
int search_offscreen; /* Search lines not displayed */
|
2002-07-19 01:08:59 +00:00
|
|
|
|
2001-05-05 17:45:54 +00:00
|
|
|
int flags = 0; /* Our new flag containing many options */
|
2002-06-13 00:40:19 +00:00
|
|
|
WINDOW *edit; /* The file portion of the editor */
|
2000-06-06 05:53:49 +00:00
|
|
|
WINDOW *topwin; /* Top line of screen */
|
|
|
|
WINDOW *bottomwin; /* Bottom buffer */
|
2000-12-14 13:56:28 +00:00
|
|
|
char *filename = NULL; /* Name of the file */
|
2002-06-28 22:45:14 +00:00
|
|
|
|
|
|
|
#ifndef NANO_SMALL
|
|
|
|
struct stat originalfilestat; /* Stat for the file as we loaded it */
|
|
|
|
#endif
|
|
|
|
|
2000-06-06 05:53:49 +00:00
|
|
|
int editwinrows = 0; /* How many rows long is the edit
|
|
|
|
window? */
|
|
|
|
filestruct *current; /* Current buffer pointer */
|
|
|
|
int current_x = 0, current_y = 0; /* Current position of X and Y in
|
|
|
|
the editor - relative to edit
|
|
|
|
window (0,0) */
|
|
|
|
filestruct *fileage = NULL; /* Our file buffer */
|
|
|
|
filestruct *edittop = NULL; /* Pointer to the top of the edit
|
|
|
|
buffer with respect to the
|
|
|
|
file struct */
|
|
|
|
filestruct *editbot = NULL; /* Same for the bottom */
|
|
|
|
filestruct *filebot = NULL; /* Last node in the file struct */
|
|
|
|
filestruct *cutbuffer = NULL; /* A place to store cut text */
|
|
|
|
|
2001-07-14 19:32:47 +00:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
2002-04-10 02:31:20 +00:00
|
|
|
openfilestruct *open_files = NULL; /* The list of open files */
|
2001-07-11 02:08:33 +00:00
|
|
|
#endif
|
|
|
|
|
2002-03-03 22:36:36 +00:00
|
|
|
#ifndef DISABLE_JUSTIFY
|
2003-01-13 01:35:15 +00:00
|
|
|
char *quotestr = NULL; /* Quote string. The default value is
|
|
|
|
set in main(). */
|
2002-07-19 01:08:59 +00:00
|
|
|
#endif
|
2002-03-03 22:36:36 +00:00
|
|
|
|
2003-02-13 03:03:49 +00:00
|
|
|
int resetstatuspos; /* Hack for resetting the status bar
|
|
|
|
cursor position */
|
2002-07-19 01:08:59 +00:00
|
|
|
char *answer = NULL; /* Answer str to many questions */
|
2000-06-06 05:53:49 +00:00
|
|
|
int totlines = 0; /* Total number of lines in the file */
|
2001-10-22 03:15:31 +00:00
|
|
|
long totsize = 0; /* Total number of bytes in the file */
|
2001-05-05 17:45:54 +00:00
|
|
|
int placewewant = 0; /* The column we'd like the cursor
|
2000-06-06 05:53:49 +00:00
|
|
|
to jump to when we go to the
|
|
|
|
next or previous line */
|
|
|
|
|
2003-01-13 01:35:15 +00:00
|
|
|
int tabsize = -1; /* Our internal tabsize variable. The
|
|
|
|
default value 8 is set in main(). */
|
2000-08-03 22:51:21 +00:00
|
|
|
|
2003-01-13 01:35:15 +00:00
|
|
|
char *hblank = NULL; /* A horizontal blank line */
|
2002-07-19 01:08:59 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2000-06-06 05:53:49 +00:00
|
|
|
char *help_text; /* The text in the help window */
|
2002-07-19 01:08:59 +00:00
|
|
|
#endif
|
2000-06-06 05:53:49 +00:00
|
|
|
|
|
|
|
/* More stuff for the marker select */
|
|
|
|
|
2003-01-13 01:35:15 +00:00
|
|
|
#ifndef NANO_SMALL
|
2000-06-06 05:53:49 +00:00
|
|
|
filestruct *mark_beginbuf; /* the begin marker buffer */
|
|
|
|
int mark_beginx; /* X value in the string to start */
|
2003-01-13 01:35:15 +00:00
|
|
|
#endif
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2001-09-19 03:19:43 +00:00
|
|
|
#ifndef DISABLE_OPERATINGDIR
|
2002-02-27 04:14:16 +00:00
|
|
|
char *operating_dir = NULL; /* Operating directory, which we can't */
|
|
|
|
char *full_operating_dir = NULL;/* go higher than */
|
2001-09-19 03:19:43 +00:00
|
|
|
#endif
|
|
|
|
|
2001-04-18 04:28:54 +00:00
|
|
|
#ifndef DISABLE_SPELLER
|
2002-05-05 23:03:54 +00:00
|
|
|
char *alt_speller = NULL; /* Alternative spell command */
|
2001-04-18 04:28:54 +00:00
|
|
|
#endif
|
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
shortcut *main_list = NULL;
|
|
|
|
shortcut *whereis_list = NULL;
|
|
|
|
shortcut *replace_list = NULL;
|
2002-02-22 04:30:50 +00:00
|
|
|
shortcut *replace_list_2 = NULL; /* 2nd half of replace dialog */
|
2002-02-15 19:17:02 +00:00
|
|
|
shortcut *goto_list = NULL;
|
|
|
|
shortcut *writefile_list = NULL;
|
|
|
|
shortcut *insertfile_list = NULL;
|
2003-01-13 01:35:15 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2002-02-15 19:17:02 +00:00
|
|
|
shortcut *help_list = NULL;
|
2003-01-13 01:35:15 +00:00
|
|
|
#endif
|
|
|
|
#ifndef DISABLE_SPELLER
|
2002-02-15 19:17:02 +00:00
|
|
|
shortcut *spell_list = NULL;
|
2003-01-13 01:35:15 +00:00
|
|
|
#endif
|
2002-04-06 05:02:14 +00:00
|
|
|
#ifndef NANO_SMALL
|
2002-03-21 05:07:28 +00:00
|
|
|
shortcut *extcmd_list = NULL;
|
2002-04-06 05:02:14 +00:00
|
|
|
#endif
|
2001-01-12 07:51:05 +00:00
|
|
|
#ifndef DISABLE_BROWSER
|
2002-02-15 19:17:02 +00:00
|
|
|
shortcut *browser_list = NULL;
|
2003-02-05 02:51:19 +00:00
|
|
|
shortcut *gotodir_list = NULL;
|
2001-01-03 07:11:47 +00:00
|
|
|
#endif
|
2003-02-05 02:51:19 +00:00
|
|
|
|
2001-04-30 11:28:46 +00:00
|
|
|
#ifdef ENABLE_COLOR
|
2002-12-22 16:30:00 +00:00
|
|
|
const colortype *colorstrings = NULL;
|
|
|
|
syntaxtype *syntaxes = NULL;
|
|
|
|
char *syntaxstr = NULL;
|
2001-04-30 11:28:46 +00:00
|
|
|
#endif
|
|
|
|
|
2002-12-22 16:30:00 +00:00
|
|
|
#if !defined(DISABLE_BROWSER) || !defined(DISABLE_HELP) || (!defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION))
|
2002-07-19 01:08:59 +00:00
|
|
|
const shortcut *currshortcut; /* Current shortcut list we're using */
|
2001-05-21 12:56:25 +00:00
|
|
|
#endif
|
2001-04-12 03:01:53 +00:00
|
|
|
|
2001-01-20 22:18:18 +00:00
|
|
|
#ifndef NANO_SMALL
|
2002-02-15 19:17:02 +00:00
|
|
|
toggle *toggles = NULL;
|
2001-01-20 22:18:18 +00:00
|
|
|
#endif
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2003-01-05 20:41:21 +00:00
|
|
|
#ifndef NANO_SMALL
|
|
|
|
historyheadtype search_history;
|
|
|
|
historyheadtype replace_history;
|
|
|
|
#endif
|
|
|
|
|
2000-07-07 01:49:52 +00:00
|
|
|
/* Regular expressions */
|
|
|
|
|
2000-09-06 13:39:17 +00:00
|
|
|
#ifdef HAVE_REGEX_H
|
2000-10-26 01:44:42 +00:00
|
|
|
regex_t search_regexp; /* Global to store compiled search regexp */
|
|
|
|
regmatch_t regmatches[10]; /* Match positions for parenthetical
|
|
|
|
subexpressions, max of 10 */
|
2002-07-19 01:08:59 +00:00
|
|
|
#endif
|
2002-03-24 23:19:32 +00:00
|
|
|
|
2003-02-03 03:32:08 +00:00
|
|
|
int curses_ended = FALSE; /* Indicates to statusbar() to simply
|
|
|
|
* write to stderr, since endwin() has
|
|
|
|
* ended curses mode. */
|
|
|
|
|
|
|
|
|
2002-04-23 10:56:06 +00:00
|
|
|
int length_of_list(const shortcut *s)
|
2002-02-15 19:17:02 +00:00
|
|
|
{
|
|
|
|
int i = 0;
|
2002-09-13 18:14:04 +00:00
|
|
|
|
2002-04-23 10:56:06 +00:00
|
|
|
for (; s != NULL; s = s->next)
|
2002-02-15 19:17:02 +00:00
|
|
|
i++;
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
|
2000-06-06 05:53:49 +00:00
|
|
|
/* Initialize a struct *without* our lovely braces =( */
|
2003-02-13 22:25:01 +00:00
|
|
|
void sc_init_one(shortcut **shortcutage, int key, const char *desc,
|
2002-04-23 10:56:06 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2003-02-13 22:25:01 +00:00
|
|
|
const char *help,
|
2002-06-28 22:45:14 +00:00
|
|
|
#endif
|
2002-08-21 16:10:37 +00:00
|
|
|
int alt, int misc1, int misc2, int view, int (*func) (void))
|
2000-06-06 05:53:49 +00:00
|
|
|
{
|
2002-02-15 19:17:02 +00:00
|
|
|
shortcut *s;
|
|
|
|
|
|
|
|
if (*shortcutage == NULL) {
|
|
|
|
*shortcutage = nmalloc(sizeof(shortcut));
|
|
|
|
s = *shortcutage;
|
|
|
|
} else {
|
|
|
|
for (s = *shortcutage; s->next != NULL; s = s->next)
|
|
|
|
;
|
|
|
|
s->next = nmalloc(sizeof(shortcut));
|
|
|
|
s = s->next;
|
|
|
|
}
|
|
|
|
|
2000-06-06 05:53:49 +00:00
|
|
|
s->val = key;
|
|
|
|
s->desc = desc;
|
2002-04-23 10:56:06 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2000-06-06 05:53:49 +00:00
|
|
|
s->help = help;
|
2002-06-28 22:45:14 +00:00
|
|
|
#endif
|
2000-06-06 05:53:49 +00:00
|
|
|
s->altval = alt;
|
|
|
|
s->misc1 = misc1;
|
|
|
|
s->misc2 = misc2;
|
|
|
|
s->viewok = view;
|
|
|
|
s->func = func;
|
2002-02-15 19:17:02 +00:00
|
|
|
s->next = NULL;
|
2000-06-06 05:53:49 +00:00
|
|
|
}
|
|
|
|
|
2001-01-20 22:18:18 +00:00
|
|
|
#ifndef NANO_SMALL
|
2002-04-23 10:56:06 +00:00
|
|
|
/* Create one new toggle structure, at the end of the toggles
|
|
|
|
* linked list. */
|
2002-08-21 16:10:37 +00:00
|
|
|
void toggle_init_one(int val, const char *desc, int flag)
|
2000-09-01 13:32:47 +00:00
|
|
|
{
|
2002-02-15 19:17:02 +00:00
|
|
|
toggle *u;
|
|
|
|
|
|
|
|
if (toggles == NULL) {
|
|
|
|
toggles = nmalloc(sizeof(toggle));
|
|
|
|
u = toggles;
|
|
|
|
} else {
|
|
|
|
for (u = toggles; u->next != NULL; u = u->next)
|
|
|
|
;
|
|
|
|
u->next = nmalloc(sizeof(toggle));
|
|
|
|
u = u->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
u->val = val;
|
|
|
|
u->desc = desc;
|
|
|
|
u->flag = flag;
|
|
|
|
u->next = NULL;
|
2000-09-01 13:32:47 +00:00
|
|
|
}
|
|
|
|
|
2002-08-21 16:10:37 +00:00
|
|
|
void toggle_init(void)
|
2000-09-01 13:32:47 +00:00
|
|
|
{
|
|
|
|
char *toggle_const_msg, *toggle_autoindent_msg, *toggle_suspend_msg,
|
2003-01-05 21:47:06 +00:00
|
|
|
*toggle_nohelp_msg, *toggle_cuttoend_msg,
|
2002-12-22 16:30:00 +00:00
|
|
|
*toggle_noconvert_msg, *toggle_dos_msg, *toggle_mac_msg,
|
|
|
|
*toggle_backup_msg, *toggle_smooth_msg;
|
|
|
|
#if !defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION)
|
|
|
|
char *toggle_mouse_msg;
|
|
|
|
#endif
|
2002-07-19 01:08:59 +00:00
|
|
|
#ifndef DISABLE_WRAPPING
|
|
|
|
char *toggle_wrap_msg;
|
|
|
|
#endif
|
2002-02-15 19:17:02 +00:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
|
|
|
char *toggle_load_msg;
|
|
|
|
#endif
|
2002-10-13 18:43:45 +00:00
|
|
|
#ifdef ENABLE_COLOR
|
|
|
|
char *toggle_syntax_msg;
|
|
|
|
#endif
|
2001-09-22 19:02:04 +00:00
|
|
|
|
2002-06-28 22:45:14 +00:00
|
|
|
/* There is no need to reinitialize the toggles. They can't
|
2003-01-13 01:35:15 +00:00
|
|
|
change. */
|
2002-06-28 22:45:14 +00:00
|
|
|
if (toggles != NULL)
|
|
|
|
return;
|
|
|
|
|
2000-09-01 13:32:47 +00:00
|
|
|
toggle_const_msg = _("Constant cursor position");
|
2000-09-03 01:06:40 +00:00
|
|
|
toggle_autoindent_msg = _("Auto indent");
|
2000-09-01 13:32:47 +00:00
|
|
|
toggle_suspend_msg = _("Suspend");
|
2000-09-02 18:44:21 +00:00
|
|
|
toggle_nohelp_msg = _("Help mode");
|
2002-12-22 16:30:00 +00:00
|
|
|
#if !defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION)
|
2000-09-01 13:32:47 +00:00
|
|
|
toggle_mouse_msg = _("Mouse support");
|
2002-12-22 16:30:00 +00:00
|
|
|
#endif
|
2000-09-01 13:32:47 +00:00
|
|
|
toggle_cuttoend_msg = _("Cut to end");
|
2002-02-15 19:17:02 +00:00
|
|
|
toggle_noconvert_msg = _("No conversion from DOS/Mac format");
|
|
|
|
toggle_dos_msg = _("Writing file in DOS format");
|
|
|
|
toggle_mac_msg = _("Writing file in Mac format");
|
2002-06-28 22:45:14 +00:00
|
|
|
toggle_backup_msg = _("Backing up file");
|
2002-02-15 19:17:02 +00:00
|
|
|
toggle_smooth_msg = _("Smooth scrolling");
|
2002-10-13 18:43:45 +00:00
|
|
|
#ifdef ENABLE_COLOR
|
|
|
|
toggle_syntax_msg = _("Color syntax highlighting");
|
|
|
|
#endif
|
2002-07-19 01:08:59 +00:00
|
|
|
#ifndef DISABLE_WRAPPING
|
2000-09-02 18:44:21 +00:00
|
|
|
toggle_wrap_msg = _("Auto wrap");
|
2002-07-19 01:08:59 +00:00
|
|
|
#endif
|
2001-07-14 19:32:47 +00:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
|
|
|
toggle_load_msg = _("Multiple file buffers");
|
2001-07-11 02:08:33 +00:00
|
|
|
#endif
|
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
toggle_init_one(TOGGLE_CONST_KEY, toggle_const_msg, CONSTUPDATE);
|
|
|
|
toggle_init_one(TOGGLE_AUTOINDENT_KEY, toggle_autoindent_msg, AUTOINDENT);
|
|
|
|
toggle_init_one(TOGGLE_SUSPEND_KEY, toggle_suspend_msg, SUSPEND);
|
|
|
|
toggle_init_one(TOGGLE_NOHELP_KEY, toggle_nohelp_msg, NO_HELP);
|
2002-07-19 01:08:59 +00:00
|
|
|
#ifndef DISABLE_WRAPPING
|
2002-02-15 19:17:02 +00:00
|
|
|
toggle_init_one(TOGGLE_WRAP_KEY, toggle_wrap_msg, NO_WRAP);
|
2002-07-19 01:08:59 +00:00
|
|
|
#endif
|
2002-12-22 16:30:00 +00:00
|
|
|
#if !defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION)
|
2002-02-15 19:17:02 +00:00
|
|
|
toggle_init_one(TOGGLE_MOUSE_KEY, toggle_mouse_msg, USE_MOUSE);
|
2002-12-22 16:30:00 +00:00
|
|
|
#endif
|
2002-02-15 19:17:02 +00:00
|
|
|
toggle_init_one(TOGGLE_CUTTOEND_KEY, toggle_cuttoend_msg, CUT_TO_END);
|
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
|
|
|
toggle_init_one(TOGGLE_LOAD_KEY, toggle_load_msg, MULTIBUFFER);
|
2000-09-06 13:39:17 +00:00
|
|
|
#endif
|
2002-02-15 19:17:02 +00:00
|
|
|
toggle_init_one(TOGGLE_NOCONVERT_KEY, toggle_noconvert_msg, NO_CONVERT);
|
|
|
|
toggle_init_one(TOGGLE_DOS_KEY, toggle_dos_msg, DOS_FILE);
|
|
|
|
toggle_init_one(TOGGLE_MAC_KEY, toggle_mac_msg, MAC_FILE);
|
2002-06-28 22:45:14 +00:00
|
|
|
toggle_init_one(TOGGLE_BACKUP_KEY, toggle_backup_msg, BACKUP_FILE);
|
2002-02-15 19:17:02 +00:00
|
|
|
toggle_init_one(TOGGLE_SMOOTH_KEY, toggle_smooth_msg, SMOOTHSCROLL);
|
2002-10-13 18:43:45 +00:00
|
|
|
#ifdef ENABLE_COLOR
|
|
|
|
toggle_init_one(TOGGLE_SYNTAX_KEY, toggle_syntax_msg, COLOR_SYNTAX);
|
|
|
|
#endif
|
2002-04-23 10:56:06 +00:00
|
|
|
}
|
2002-09-06 20:35:28 +00:00
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
/* Deallocate all of the toggles. */
|
|
|
|
void free_toggles(void)
|
|
|
|
{
|
|
|
|
while (toggles != NULL) {
|
|
|
|
toggle *pt = toggles; /* Think "previous toggle" */
|
|
|
|
|
|
|
|
toggles = toggles->next;
|
|
|
|
free(pt);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
2002-02-15 19:17:02 +00:00
|
|
|
#endif /* !NANO_SMALL */
|
2002-04-23 10:56:06 +00:00
|
|
|
|
|
|
|
/* Deallocate the given shortcut. */
|
2002-08-21 16:10:37 +00:00
|
|
|
void free_shortcutage(shortcut **shortcutage)
|
2002-04-23 10:56:06 +00:00
|
|
|
{
|
|
|
|
assert(shortcutage != NULL);
|
2002-07-19 01:08:59 +00:00
|
|
|
while (*shortcutage != NULL) {
|
|
|
|
shortcut *ps = *shortcutage;
|
|
|
|
*shortcutage = (*shortcutage)->next;
|
2002-04-23 10:56:06 +00:00
|
|
|
free(ps);
|
|
|
|
}
|
2000-09-01 13:32:47 +00:00
|
|
|
}
|
|
|
|
|
2000-11-27 22:58:23 +00:00
|
|
|
void shortcut_init(int unjustify)
|
2000-06-06 05:53:49 +00:00
|
|
|
{
|
2002-04-23 10:56:06 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2003-02-13 22:25:01 +00:00
|
|
|
const char *nano_help_msg = "", *nano_writeout_msg = "", *nano_exit_msg =
|
2002-06-28 22:45:14 +00:00
|
|
|
"", *nano_goto_msg = "", *nano_justify_msg =
|
|
|
|
"", *nano_replace_msg = "", *nano_insert_msg =
|
|
|
|
"", *nano_whereis_msg = "", *nano_prevpage_msg =
|
|
|
|
"", *nano_nextpage_msg = "", *nano_cut_msg =
|
|
|
|
"", *nano_uncut_msg = "", *nano_cursorpos_msg =
|
2000-06-06 05:53:49 +00:00
|
|
|
"", *nano_spell_msg = "", *nano_up_msg = "", *nano_down_msg =
|
|
|
|
"", *nano_forward_msg = "", *nano_back_msg = "", *nano_home_msg =
|
|
|
|
"", *nano_end_msg = "", *nano_firstline_msg =
|
|
|
|
"", *nano_lastline_msg = "", *nano_refresh_msg =
|
|
|
|
"", *nano_mark_msg = "", *nano_delete_msg =
|
|
|
|
"", *nano_backspace_msg = "", *nano_tab_msg =
|
2002-06-28 22:45:14 +00:00
|
|
|
"", *nano_enter_msg = "", *nano_cancel_msg =
|
2002-02-15 19:17:02 +00:00
|
|
|
"", *nano_unjustify_msg = "", *nano_append_msg =
|
2002-06-28 22:45:14 +00:00
|
|
|
"", *nano_prepend_msg = "", *nano_tofiles_msg =
|
|
|
|
"", *nano_gotodir_msg = "", *nano_case_msg =
|
|
|
|
"", *nano_reverse_msg = "", *nano_execute_msg =
|
|
|
|
"", *nano_dos_msg = "", *nano_mac_msg =
|
2003-01-05 20:41:21 +00:00
|
|
|
"", *nano_backup_msg = "", *nano_editstr_msg = "";
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2002-04-06 05:02:14 +00:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
2003-02-13 22:25:01 +00:00
|
|
|
const char *nano_openprev_msg = "", *nano_opennext_msg =
|
2002-09-06 20:35:28 +00:00
|
|
|
"", *nano_multibuffer_msg = "";
|
2002-04-06 05:02:14 +00:00
|
|
|
#endif
|
2001-09-28 19:53:11 +00:00
|
|
|
#ifdef HAVE_REGEX_H
|
2003-02-13 22:25:01 +00:00
|
|
|
const char *nano_regexp_msg = "", *nano_bracket_msg = "";
|
2001-09-28 19:53:11 +00:00
|
|
|
#endif
|
2001-01-05 05:41:07 +00:00
|
|
|
|
2000-06-06 05:53:49 +00:00
|
|
|
nano_help_msg = _("Invoke the help menu");
|
|
|
|
nano_writeout_msg = _("Write the current file to disk");
|
2001-07-14 19:32:47 +00:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
2001-07-11 02:08:33 +00:00
|
|
|
nano_exit_msg = _("Close currently loaded file/Exit from nano");
|
|
|
|
#else
|
2000-06-06 05:53:49 +00:00
|
|
|
nano_exit_msg = _("Exit from nano");
|
2001-07-11 02:08:33 +00:00
|
|
|
#endif
|
2002-06-21 03:20:06 +00:00
|
|
|
nano_goto_msg = _("Go to a specific line number");
|
2000-06-06 05:53:49 +00:00
|
|
|
nano_justify_msg = _("Justify the current paragraph");
|
2000-11-27 22:58:23 +00:00
|
|
|
nano_unjustify_msg = _("Unjustify after a justify");
|
2000-06-06 05:53:49 +00:00
|
|
|
nano_replace_msg = _("Replace text within the editor");
|
|
|
|
nano_insert_msg = _("Insert another file into the current one");
|
|
|
|
nano_whereis_msg = _("Search for text within the editor");
|
|
|
|
nano_prevpage_msg = _("Move to the previous screen");
|
|
|
|
nano_nextpage_msg = _("Move to the next screen");
|
|
|
|
nano_cut_msg = _("Cut the current line and store it in the cutbuffer");
|
|
|
|
nano_uncut_msg = _("Uncut from the cutbuffer into the current line");
|
2001-05-05 17:45:54 +00:00
|
|
|
nano_cursorpos_msg = _("Show the position of the cursor");
|
2002-06-28 22:45:14 +00:00
|
|
|
nano_spell_msg = _("Invoke the spell checker, if available");
|
2000-06-06 05:53:49 +00:00
|
|
|
nano_up_msg = _("Move up one line");
|
|
|
|
nano_down_msg = _("Move down one line");
|
|
|
|
nano_forward_msg = _("Move forward one character");
|
|
|
|
nano_back_msg = _("Move back one character");
|
|
|
|
nano_home_msg = _("Move to the beginning of the current line");
|
|
|
|
nano_end_msg = _("Move to the end of the current line");
|
|
|
|
nano_firstline_msg = _("Go to the first line of the file");
|
|
|
|
nano_lastline_msg = _("Go to the last line of the file");
|
|
|
|
nano_refresh_msg = _("Refresh (redraw) the current screen");
|
|
|
|
nano_mark_msg = _("Mark text at the current cursor location");
|
|
|
|
nano_delete_msg = _("Delete the character under the cursor");
|
|
|
|
nano_backspace_msg =
|
|
|
|
_("Delete the character to the left of the cursor");
|
|
|
|
nano_tab_msg = _("Insert a tab character");
|
|
|
|
nano_enter_msg = _("Insert a carriage return at the cursor position");
|
|
|
|
nano_case_msg =
|
|
|
|
_("Make the current search or replace case (in)sensitive");
|
2001-01-03 07:11:47 +00:00
|
|
|
nano_tofiles_msg = _("Go to file browser");
|
2002-03-21 05:07:28 +00:00
|
|
|
nano_execute_msg = _("Execute external command");
|
2002-06-21 03:20:06 +00:00
|
|
|
nano_gotodir_msg = _("Go to directory");
|
2000-06-06 05:53:49 +00:00
|
|
|
nano_cancel_msg = _("Cancel the current function");
|
2001-05-29 04:21:44 +00:00
|
|
|
nano_append_msg = _("Append to the current file");
|
2002-04-16 03:15:47 +00:00
|
|
|
nano_prepend_msg = _("Prepend to the current file");
|
2001-09-22 22:14:25 +00:00
|
|
|
nano_reverse_msg = _("Search backwards");
|
2002-02-15 19:17:02 +00:00
|
|
|
nano_dos_msg = _("Write file out in DOS format");
|
|
|
|
nano_mac_msg = _("Write file out in Mac format");
|
2002-06-28 22:45:14 +00:00
|
|
|
nano_backup_msg = _("Back up original file when saving");
|
2003-01-05 20:41:21 +00:00
|
|
|
nano_editstr_msg = _("Edit the previous search/replace strings");
|
2001-09-28 19:53:11 +00:00
|
|
|
#ifdef HAVE_REGEX_H
|
2002-06-28 22:45:14 +00:00
|
|
|
nano_regexp_msg = _("Use regular expressions");
|
2001-09-22 22:14:25 +00:00
|
|
|
nano_bracket_msg = _("Find other bracket");
|
2001-09-28 19:53:11 +00:00
|
|
|
#endif
|
2002-02-15 19:17:02 +00:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
|
|
|
nano_openprev_msg = _("Open previously loaded file");
|
|
|
|
nano_opennext_msg = _("Open next loaded file");
|
2002-09-03 22:58:40 +00:00
|
|
|
nano_multibuffer_msg = _("Toggle insert into new buffer");
|
2000-06-06 05:53:49 +00:00
|
|
|
#endif
|
2002-04-23 10:56:06 +00:00
|
|
|
#endif /* !DISABLE_HELP */
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2002-04-23 10:56:06 +00:00
|
|
|
free_shortcutage(&main_list);
|
2002-02-27 04:14:16 +00:00
|
|
|
|
2002-04-23 10:56:06 +00:00
|
|
|
/* The following macro is to be used in calling sc_init_one. The point is
|
|
|
|
* that sc_init_one takes 9 arguments, unless DISABLE_HELP is defined,
|
|
|
|
* when the fourth one should not be there. */
|
|
|
|
#ifdef DISABLE_HELP
|
|
|
|
# define IFHELP(help, nextvar) nextvar
|
|
|
|
#else
|
|
|
|
# define IFHELP(help, nextvar) help, nextvar
|
|
|
|
#endif
|
|
|
|
|
|
|
|
sc_init_one(&main_list, NANO_HELP_KEY, _("Get Help"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_help_msg, 0), NANO_HELP_FKEY, 0, VIEW,
|
2002-04-23 10:56:06 +00:00
|
|
|
do_help);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2001-07-14 19:32:47 +00:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
2002-12-22 16:30:00 +00:00
|
|
|
if (open_files != NULL && (open_files->prev != NULL || open_files->next != NULL))
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&main_list, NANO_EXIT_KEY, _("Close"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_exit_msg, 0), NANO_EXIT_FKEY, 0, VIEW,
|
2002-04-23 10:56:06 +00:00
|
|
|
do_exit);
|
2001-07-11 02:08:33 +00:00
|
|
|
else
|
|
|
|
#endif
|
2002-06-28 22:45:14 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&main_list, NANO_EXIT_KEY, _("Exit"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_exit_msg, 0), NANO_EXIT_FKEY, 0, VIEW,
|
2002-04-23 10:56:06 +00:00
|
|
|
do_exit);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&main_list, NANO_WRITEOUT_KEY, _("WriteOut"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_writeout_msg, 0),
|
|
|
|
NANO_WRITEOUT_FKEY, 0, NOVIEW, do_writeout_void);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2003-01-05 21:47:06 +00:00
|
|
|
sc_init_one(&main_list, NANO_JUSTIFY_KEY, _("Justify"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_justify_msg, 0), NANO_JUSTIFY_FKEY, 0,
|
2000-09-11 22:33:54 +00:00
|
|
|
NOVIEW, do_justify);
|
2001-02-11 19:05:05 +00:00
|
|
|
|
2003-03-11 03:50:40 +00:00
|
|
|
/* this is so we can view multiple files */
|
|
|
|
sc_init_one(&main_list, NANO_INSERTFILE_KEY, _("Read File"),
|
|
|
|
IFHELP(nano_insert_msg, 0), NANO_INSERTFILE_FKEY, 0,
|
2002-01-02 15:12:21 +00:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
2003-03-11 03:50:40 +00:00
|
|
|
VIEW
|
2002-01-02 15:12:21 +00:00
|
|
|
#else
|
2003-03-11 03:50:40 +00:00
|
|
|
NOVIEW
|
2002-01-02 15:12:21 +00:00
|
|
|
#endif
|
2003-03-11 03:50:40 +00:00
|
|
|
, do_insertfile_void);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&main_list, NANO_WHEREIS_KEY, _("Where Is"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_whereis_msg, 0),
|
|
|
|
NANO_WHEREIS_FKEY, 0, VIEW, do_search);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&main_list, NANO_PREVPAGE_KEY, _("Prev Page"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_prevpage_msg, 0),
|
|
|
|
NANO_PREVPAGE_FKEY, KEY_PPAGE, VIEW, do_page_up);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&main_list, NANO_NEXTPAGE_KEY, _("Next Page"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_nextpage_msg, 0),
|
|
|
|
NANO_NEXTPAGE_FKEY, KEY_NPAGE, VIEW, do_page_down);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&main_list, NANO_CUT_KEY, _("Cut Text"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_cut_msg, 0),
|
|
|
|
NANO_CUT_FKEY, 0, NOVIEW, do_cut_text);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2000-11-27 22:58:23 +00:00
|
|
|
if (unjustify)
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&main_list, NANO_UNJUSTIFY_KEY, _("UnJustify"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_unjustify_msg, 0),
|
|
|
|
0, 0, NOVIEW, do_uncut_text);
|
2000-11-27 22:58:23 +00:00
|
|
|
else
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&main_list, NANO_UNCUT_KEY, _("UnCut Txt"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_uncut_msg, 0),
|
|
|
|
NANO_UNCUT_FKEY, 0, NOVIEW, do_uncut_text);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&main_list, NANO_CURSORPOS_KEY, _("Cur Pos"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_cursorpos_msg, 0),
|
|
|
|
NANO_CURSORPOS_FKEY, 0, VIEW, do_cursorpos_void);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&main_list, NANO_SPELL_KEY, _("To Spell"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_spell_msg, 0),
|
|
|
|
NANO_SPELL_FKEY, 0, NOVIEW, do_spell);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&main_list, NANO_UP_KEY, _("Up"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_up_msg, 0),
|
|
|
|
KEY_UP, 0, VIEW, do_up);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&main_list, NANO_DOWN_KEY, _("Down"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_down_msg, 0),
|
|
|
|
KEY_DOWN, 0, VIEW, do_down);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&main_list, NANO_FORWARD_KEY, _("Forward"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_forward_msg, 0),
|
|
|
|
KEY_RIGHT, 0, VIEW, do_right);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&main_list, NANO_BACK_KEY, _("Back"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_back_msg, 0),
|
|
|
|
KEY_LEFT, 0, VIEW, do_left);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&main_list, NANO_HOME_KEY, _("Home"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_home_msg, 0),
|
|
|
|
KEY_HOME, 362, VIEW, do_home);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&main_list, NANO_END_KEY, _("End"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_end_msg, 0),
|
|
|
|
KEY_END, 385, VIEW, do_end);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&main_list, NANO_REFRESH_KEY, _("Refresh"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_refresh_msg, 0),
|
|
|
|
0, 0, VIEW, total_refresh);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&main_list, NANO_MARK_KEY, _("Mark Text"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_mark_msg, NANO_ALT_MARK_KEY),
|
|
|
|
0, 0, NOVIEW, do_mark);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&main_list, NANO_DELETE_KEY, _("Delete"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_delete_msg, 0), KEY_DC,
|
2000-06-06 05:53:49 +00:00
|
|
|
NANO_CONTROL_D, NOVIEW, do_delete);
|
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&main_list, NANO_BACKSPACE_KEY, _("Backspace"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_backspace_msg, 0),
|
2000-06-06 05:53:49 +00:00
|
|
|
KEY_BACKSPACE, 127, NOVIEW, do_backspace);
|
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&main_list, NANO_TAB_KEY, _("Tab"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_tab_msg, 0), 0, 0, NOVIEW, do_tab);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2003-01-05 21:47:06 +00:00
|
|
|
sc_init_one(&main_list, NANO_REPLACE_KEY, _("Replace"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_replace_msg, NANO_ALT_REPLACE_KEY),
|
|
|
|
NANO_REPLACE_FKEY, 0, NOVIEW, do_replace);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&main_list, NANO_ENTER_KEY, _("Enter"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_enter_msg, 0),
|
2002-07-19 01:08:59 +00:00
|
|
|
KEY_ENTER, NANO_CONTROL_M, NOVIEW, do_enter);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2002-06-21 03:20:06 +00:00
|
|
|
sc_init_one(&main_list, NANO_GOTO_KEY, _("Go To Line"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_goto_msg, NANO_ALT_GOTO_KEY),
|
|
|
|
NANO_GOTO_FKEY, 0, VIEW, do_gotoline_void);
|
2001-02-11 19:05:05 +00:00
|
|
|
|
2002-06-21 03:20:06 +00:00
|
|
|
#ifndef NANO_SMALL
|
|
|
|
sc_init_one(&main_list, NANO_NEXTWORD_KEY, _("Next Word"),
|
|
|
|
IFHELP(_("Move forward one word"), 0),
|
2002-07-19 01:08:59 +00:00
|
|
|
0, 0, VIEW, do_next_word);
|
2002-06-21 03:20:06 +00:00
|
|
|
|
|
|
|
sc_init_one(&main_list, -9, _("Prev Word"),
|
|
|
|
IFHELP(_("Move backward one word"), NANO_PREVWORD_KEY), 0, 0,
|
2002-07-19 01:08:59 +00:00
|
|
|
VIEW, do_prev_word);
|
2002-06-21 03:20:06 +00:00
|
|
|
#endif
|
2002-06-28 22:45:14 +00:00
|
|
|
#if !defined(NANO_SMALL) && defined(HAVE_REGEX_H)
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&main_list, -9, _("Find Other Bracket"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_bracket_msg, NANO_BRACKET_KEY),
|
|
|
|
0, 0, VIEW, do_find_bracket);
|
2001-09-22 22:14:25 +00:00
|
|
|
#endif
|
2002-02-15 19:17:02 +00:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
|
|
|
sc_init_one(&main_list, -9, _("Previous File"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_openprev_msg, NANO_OPENPREV_KEY),
|
|
|
|
0, 0, VIEW, open_prevfile_void);
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&main_list, -9, _("Next File"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_opennext_msg, NANO_OPENNEXT_KEY),
|
|
|
|
0, 0, VIEW, open_nextfile_void);
|
2002-02-15 19:17:02 +00:00
|
|
|
#endif
|
2001-10-22 03:15:31 +00:00
|
|
|
|
2002-04-23 10:56:06 +00:00
|
|
|
free_shortcutage(&whereis_list);
|
2002-02-27 04:14:16 +00:00
|
|
|
|
2002-05-16 23:30:14 +00:00
|
|
|
sc_init_one(&whereis_list, NANO_HELP_KEY, _("Get Help"),
|
|
|
|
IFHELP(nano_help_msg, 0), 0, 0, VIEW, do_help);
|
2001-10-22 03:15:31 +00:00
|
|
|
|
2002-05-16 23:30:14 +00:00
|
|
|
sc_init_one(&whereis_list, NANO_CANCEL_KEY, _("Cancel"),
|
|
|
|
IFHELP(nano_cancel_msg, 0), 0, 0, VIEW, 0);
|
2001-10-22 03:15:31 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&whereis_list, NANO_FIRSTLINE_KEY, _("First Line"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_firstline_msg, 0),
|
|
|
|
0, 0, VIEW, do_first_line);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&whereis_list, NANO_LASTLINE_KEY, _("Last Line"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_lastline_msg, 0), 0, 0, VIEW, do_last_line);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&whereis_list, NANO_OTHERSEARCH_KEY, _("Replace"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_replace_msg, 0), 0, 0, VIEW, do_replace);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2002-07-29 23:46:38 +00:00
|
|
|
sc_init_one(&whereis_list, NANO_FROMSEARCHTOGOTO_KEY, _("Go To Line"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_goto_msg, 0), 0, 0, VIEW, do_gotoline_void);
|
2000-06-29 01:30:04 +00:00
|
|
|
|
2001-07-16 00:48:53 +00:00
|
|
|
#ifndef NANO_SMALL
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&whereis_list, TOGGLE_CASE_KEY, _("Case Sens"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_case_msg, 0), 0, 0, VIEW, 0);
|
2001-06-14 02:54:22 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&whereis_list, TOGGLE_BACKWARDS_KEY, _("Direction"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_reverse_msg, 0), 0, 0, VIEW, 0);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2001-06-14 02:54:22 +00:00
|
|
|
#ifdef HAVE_REGEX_H
|
2002-05-16 23:30:14 +00:00
|
|
|
sc_init_one(&whereis_list, TOGGLE_REGEXP_KEY, _("Regexp"),
|
|
|
|
IFHELP(nano_regexp_msg, 0), 0, 0, VIEW, 0);
|
2001-06-14 02:54:22 +00:00
|
|
|
#endif
|
2003-01-05 20:41:21 +00:00
|
|
|
|
|
|
|
#ifndef NANO_SMALL
|
|
|
|
sc_init_one(&whereis_list, KEY_UP, _("History"),
|
2003-01-13 01:35:15 +00:00
|
|
|
IFHELP(nano_editstr_msg, 0), NANO_UP_KEY, 0, VIEW, 0);
|
2003-01-05 20:41:21 +00:00
|
|
|
#endif
|
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
#endif /* !NANO_SMALL */
|
2001-07-16 00:48:53 +00:00
|
|
|
|
2002-04-23 10:56:06 +00:00
|
|
|
free_shortcutage(&replace_list);
|
2001-07-16 00:48:53 +00:00
|
|
|
|
2002-05-16 23:30:14 +00:00
|
|
|
sc_init_one(&replace_list, NANO_HELP_KEY, _("Get Help"),
|
|
|
|
IFHELP(nano_help_msg, 0), 0, 0, VIEW, do_help);
|
2001-10-22 03:15:31 +00:00
|
|
|
|
2002-05-16 23:30:14 +00:00
|
|
|
sc_init_one(&replace_list, NANO_CANCEL_KEY, _("Cancel"),
|
|
|
|
IFHELP(nano_cancel_msg, 0), 0, 0, VIEW, 0);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&replace_list, NANO_FIRSTLINE_KEY, _("First Line"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_firstline_msg, 0), 0, 0, VIEW, do_first_line);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&replace_list, NANO_LASTLINE_KEY, _("Last Line"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_lastline_msg, 0), 0, 0, VIEW, do_last_line);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&replace_list, NANO_OTHERSEARCH_KEY, _("No Replace"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_whereis_msg, 0), 0, 0, VIEW, do_search);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2002-06-21 03:20:06 +00:00
|
|
|
sc_init_one(&replace_list, NANO_FROMSEARCHTOGOTO_KEY, _("Go To Line"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_goto_msg, 0), 0, 0, VIEW, do_gotoline_void);
|
2000-06-29 01:30:04 +00:00
|
|
|
|
2001-07-16 00:48:53 +00:00
|
|
|
#ifndef NANO_SMALL
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&replace_list, TOGGLE_CASE_KEY, _("Case Sens"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_case_msg, 0), 0, 0, VIEW, 0);
|
2001-06-14 02:54:22 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&replace_list, TOGGLE_BACKWARDS_KEY, _("Direction"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_reverse_msg, 0), 0, 0, VIEW, 0);
|
2000-10-31 05:10:10 +00:00
|
|
|
|
2001-06-14 02:54:22 +00:00
|
|
|
#ifdef HAVE_REGEX_H
|
2002-05-16 23:30:14 +00:00
|
|
|
sc_init_one(&replace_list, TOGGLE_REGEXP_KEY, _("Regexp"),
|
|
|
|
IFHELP(nano_regexp_msg, 0), 0, 0, VIEW, 0);
|
2001-06-14 02:54:22 +00:00
|
|
|
#endif
|
2003-01-05 20:41:21 +00:00
|
|
|
|
|
|
|
sc_init_one(&replace_list, KEY_UP, _("History"),
|
2003-01-13 01:35:15 +00:00
|
|
|
IFHELP(nano_editstr_msg, 0), NANO_UP_KEY, 0, VIEW, 0);
|
2002-02-15 19:17:02 +00:00
|
|
|
#endif /* !NANO_SMALL */
|
2001-07-16 00:48:53 +00:00
|
|
|
|
2002-04-23 10:56:06 +00:00
|
|
|
free_shortcutage(&replace_list_2);
|
2000-10-31 05:10:10 +00:00
|
|
|
|
2002-05-16 23:30:14 +00:00
|
|
|
sc_init_one(&replace_list_2, NANO_HELP_KEY, _("Get Help"),
|
|
|
|
IFHELP(nano_help_msg, 0), 0, 0, VIEW, do_help);
|
2001-10-22 03:15:31 +00:00
|
|
|
|
2002-05-16 23:30:14 +00:00
|
|
|
sc_init_one(&replace_list_2, NANO_CANCEL_KEY, _("Cancel"),
|
|
|
|
IFHELP(nano_cancel_msg, 0), 0, 0, VIEW, 0);
|
2000-10-31 05:10:10 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&replace_list_2, NANO_FIRSTLINE_KEY, _("First Line"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_firstline_msg, 0), 0, 0, VIEW, do_first_line);
|
2000-10-31 05:10:10 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&replace_list_2, NANO_LASTLINE_KEY, _("Last Line"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_lastline_msg, 0), 0, 0, VIEW, do_last_line);
|
2000-10-31 05:10:10 +00:00
|
|
|
|
2003-01-05 20:41:21 +00:00
|
|
|
#ifndef NANO_SMALL
|
|
|
|
sc_init_one(&replace_list_2, KEY_UP, _("History"),
|
2003-01-13 01:35:15 +00:00
|
|
|
IFHELP(nano_editstr_msg, 0), NANO_UP_KEY, 0, VIEW, 0);
|
2003-01-05 20:41:21 +00:00
|
|
|
#endif
|
|
|
|
|
2002-04-23 10:56:06 +00:00
|
|
|
free_shortcutage(&goto_list);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2002-05-16 23:30:14 +00:00
|
|
|
sc_init_one(&goto_list, NANO_HELP_KEY, _("Get Help"),
|
|
|
|
IFHELP(nano_help_msg, 0), 0, 0, VIEW, do_help);
|
2001-10-22 03:15:31 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&goto_list, NANO_CANCEL_KEY, _("Cancel"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_cancel_msg, 0), 0, 0, VIEW, 0);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&goto_list, NANO_FIRSTLINE_KEY, _("First Line"),
|
2002-07-19 01:08:59 +00:00
|
|
|
IFHELP(nano_firstline_msg, 0), 0, 0, VIEW, do_first_line);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&goto_list, NANO_LASTLINE_KEY, _("Last Line"),
|
2002-07-19 01:08:59 +00:00
|
|
|
IFHELP(nano_lastline_msg, 0), 0, 0, VIEW, do_last_line);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2003-01-13 01:35:15 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2002-04-23 10:56:06 +00:00
|
|
|
free_shortcutage(&help_list);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&help_list, NANO_PREVPAGE_KEY, _("Prev Page"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_prevpage_msg, 0), NANO_PREVPAGE_FKEY,
|
|
|
|
KEY_PPAGE, VIEW, do_page_up);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&help_list, NANO_NEXTPAGE_KEY, _("Next Page"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_nextpage_msg, 0),
|
|
|
|
NANO_NEXTPAGE_FKEY, KEY_NPAGE, VIEW, do_page_down);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&help_list, NANO_EXIT_KEY, _("Exit"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_exit_msg, 0), NANO_EXIT_FKEY, 0, VIEW,
|
|
|
|
do_exit);
|
2003-01-13 01:35:15 +00:00
|
|
|
#endif
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2002-04-23 10:56:06 +00:00
|
|
|
free_shortcutage(&writefile_list);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2002-05-16 23:30:14 +00:00
|
|
|
sc_init_one(&writefile_list, NANO_HELP_KEY, _("Get Help"),
|
|
|
|
IFHELP(nano_help_msg, 0), 0, 0, VIEW, do_help);
|
2001-10-22 03:15:31 +00:00
|
|
|
|
2001-01-12 07:51:05 +00:00
|
|
|
#ifndef DISABLE_BROWSER
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&writefile_list, NANO_TOFILES_KEY, _("To Files"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_tofiles_msg, 0), 0, 0, NOVIEW, 0);
|
2001-01-03 07:11:47 +00:00
|
|
|
#endif
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
#ifndef NANO_SMALL
|
2002-05-16 23:30:14 +00:00
|
|
|
sc_init_one(&writefile_list, TOGGLE_DOS_KEY, _("DOS Format"),
|
|
|
|
IFHELP(nano_dos_msg, 0), 0, 0, NOVIEW, 0);
|
2002-02-15 19:17:02 +00:00
|
|
|
|
2002-05-16 23:30:14 +00:00
|
|
|
sc_init_one(&writefile_list, TOGGLE_MAC_KEY, _("Mac Format"),
|
|
|
|
IFHELP(nano_mac_msg, 0), 0, 0, NOVIEW, 0);
|
2002-02-15 19:17:02 +00:00
|
|
|
#endif
|
|
|
|
|
2002-05-16 23:30:14 +00:00
|
|
|
sc_init_one(&writefile_list, NANO_APPEND_KEY, _("Append"),
|
|
|
|
IFHELP(nano_append_msg, 0), 0, 0, NOVIEW, 0);
|
2001-05-29 04:21:44 +00:00
|
|
|
|
2002-05-16 23:30:14 +00:00
|
|
|
sc_init_one(&writefile_list, NANO_PREPEND_KEY, _("Prepend"),
|
|
|
|
IFHELP(nano_prepend_msg, 0), 0, 0, NOVIEW, 0);
|
2002-04-16 03:15:47 +00:00
|
|
|
|
2002-06-28 22:45:14 +00:00
|
|
|
#ifndef NANO_SMALL
|
|
|
|
sc_init_one(&writefile_list, TOGGLE_BACKUP_KEY, _("Backup File"),
|
|
|
|
IFHELP(nano_backup_msg, 0), 0, 0, NOVIEW, 0);
|
|
|
|
#endif
|
|
|
|
|
2002-05-16 23:30:14 +00:00
|
|
|
sc_init_one(&writefile_list, NANO_CANCEL_KEY, _("Cancel"),
|
|
|
|
IFHELP(nano_cancel_msg, 0), 0, 0, VIEW, 0);
|
2002-02-15 19:17:02 +00:00
|
|
|
|
2002-04-23 10:56:06 +00:00
|
|
|
free_shortcutage(&insertfile_list);
|
2002-02-15 19:17:02 +00:00
|
|
|
|
2002-05-16 23:30:14 +00:00
|
|
|
sc_init_one(&insertfile_list, NANO_HELP_KEY, _("Get Help"),
|
|
|
|
IFHELP(nano_help_msg, 0), 0, 0, VIEW, do_help);
|
2001-10-22 03:15:31 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&insertfile_list, NANO_CANCEL_KEY, _("Cancel"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_cancel_msg, 0), 0, 0, VIEW, 0);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2001-05-29 04:21:44 +00:00
|
|
|
#ifndef DISABLE_BROWSER
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&insertfile_list, NANO_TOFILES_KEY, _("To Files"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_tofiles_msg, 0), 0, 0, NOVIEW, 0);
|
2001-05-29 04:21:44 +00:00
|
|
|
#endif
|
2002-03-21 05:07:28 +00:00
|
|
|
#ifndef NANO_SMALL
|
|
|
|
sc_init_one(&insertfile_list, NANO_EXTCMD_KEY, _("Execute Command"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_execute_msg, 0), 0, 0, NOVIEW, 0);
|
2002-09-03 22:58:40 +00:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
2002-09-13 18:14:04 +00:00
|
|
|
sc_init_one(&insertfile_list, TOGGLE_LOAD_KEY, _("New Buffer"),
|
2002-09-03 22:58:40 +00:00
|
|
|
IFHELP(nano_multibuffer_msg, 0), 0, 0, NOVIEW, 0);
|
2002-09-13 18:14:04 +00:00
|
|
|
#endif
|
2002-09-03 22:58:40 +00:00
|
|
|
#endif
|
2001-05-29 04:21:44 +00:00
|
|
|
|
2003-01-13 01:35:15 +00:00
|
|
|
#ifndef DISABLE_SPELLER
|
2002-04-23 10:56:06 +00:00
|
|
|
free_shortcutage(&spell_list);
|
2002-04-06 05:02:14 +00:00
|
|
|
|
2002-05-16 23:30:14 +00:00
|
|
|
sc_init_one(&spell_list, NANO_HELP_KEY, _("Get Help"),
|
|
|
|
IFHELP(nano_help_msg, 0), 0, 0, VIEW, do_help);
|
2001-05-29 04:21:44 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&spell_list, NANO_CANCEL_KEY, _("Cancel"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_cancel_msg, 0), 0, 0, VIEW, 0);
|
2003-01-13 01:35:15 +00:00
|
|
|
#endif
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2002-03-21 05:07:28 +00:00
|
|
|
#ifndef NANO_SMALL
|
2002-04-23 10:56:06 +00:00
|
|
|
free_shortcutage(&extcmd_list);
|
2002-04-06 05:02:14 +00:00
|
|
|
|
2002-05-16 23:30:14 +00:00
|
|
|
sc_init_one(&extcmd_list, NANO_HELP_KEY, _("Get Help"),
|
|
|
|
IFHELP(nano_help_msg, 0), 0, 0, VIEW, do_help);
|
2002-03-21 05:07:28 +00:00
|
|
|
|
|
|
|
sc_init_one(&extcmd_list, NANO_CANCEL_KEY, _("Cancel"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_cancel_msg, 0), 0, 0, VIEW, 0);
|
2002-03-21 05:07:28 +00:00
|
|
|
#endif
|
2001-10-22 03:15:31 +00:00
|
|
|
|
2001-01-12 07:51:05 +00:00
|
|
|
#ifndef DISABLE_BROWSER
|
2002-04-23 10:56:06 +00:00
|
|
|
free_shortcutage(&browser_list);
|
2002-02-27 04:14:16 +00:00
|
|
|
|
2002-05-16 23:30:14 +00:00
|
|
|
sc_init_one(&browser_list, NANO_HELP_KEY, _("Get Help"),
|
|
|
|
IFHELP(nano_help_msg, 0), 0, 0, VIEW, do_help);
|
2001-10-22 03:15:31 +00:00
|
|
|
|
2002-06-21 03:20:06 +00:00
|
|
|
sc_init_one(&browser_list, NANO_CANCEL_KEY, _("Cancel"),
|
|
|
|
IFHELP(nano_cancel_msg, 0), NANO_EXIT_FKEY, 0, VIEW, 0);
|
2001-10-22 03:15:31 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&browser_list, NANO_PREVPAGE_KEY, _("Prev Page"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_prevpage_msg, 0), NANO_PREVPAGE_FKEY,
|
|
|
|
KEY_PPAGE, VIEW, 0);
|
2001-01-03 07:11:47 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&browser_list, NANO_NEXTPAGE_KEY, _("Next Page"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_nextpage_msg, 0), NANO_NEXTPAGE_FKEY,
|
|
|
|
KEY_NPAGE, VIEW, 0);
|
2001-01-03 07:11:47 +00:00
|
|
|
|
2002-06-21 03:20:06 +00:00
|
|
|
sc_init_one(&browser_list, NANO_GOTO_KEY, _("Go To Dir"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_gotodir_msg, NANO_ALT_GOTO_KEY),
|
|
|
|
NANO_GOTO_FKEY, 0, VIEW, 0);
|
2001-04-14 06:50:24 +00:00
|
|
|
|
2002-04-23 10:56:06 +00:00
|
|
|
free_shortcutage(&gotodir_list);
|
2002-02-27 04:14:16 +00:00
|
|
|
|
2002-05-16 23:30:14 +00:00
|
|
|
sc_init_one(&gotodir_list, NANO_HELP_KEY, _("Get Help"),
|
|
|
|
IFHELP(nano_help_msg, 0), 0, 0, VIEW, do_help);
|
2001-01-03 07:11:47 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
sc_init_one(&gotodir_list, NANO_CANCEL_KEY, _("Cancel"),
|
2002-05-16 23:30:14 +00:00
|
|
|
IFHELP(nano_cancel_msg, 0), 0, 0, VIEW, 0);
|
2001-01-03 07:11:47 +00:00
|
|
|
#endif
|
|
|
|
|
2002-12-22 16:30:00 +00:00
|
|
|
#if !defined(DISABLE_BROWSER) || !defined(DISABLE_HELP) || (!defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION))
|
2002-02-15 19:17:02 +00:00
|
|
|
currshortcut = main_list;
|
|
|
|
#endif
|
2002-02-27 04:14:16 +00:00
|
|
|
#ifndef NANO_SMALL
|
2002-04-23 10:56:06 +00:00
|
|
|
toggle_init();
|
2002-02-27 04:14:16 +00:00
|
|
|
#endif
|
2002-04-23 10:56:06 +00:00
|
|
|
}
|
2002-02-27 04:14:16 +00:00
|
|
|
|
2002-05-12 19:52:15 +00:00
|
|
|
/* This function is called just before calling exit(). Practically, the
|
|
|
|
* only effect is to cause a segmentation fault if the various data
|
|
|
|
* structures got bolloxed earlier. Thus, we don't bother having this
|
2002-07-19 01:08:59 +00:00
|
|
|
* function unless debugging is turned on. */
|
2002-05-12 19:52:15 +00:00
|
|
|
#ifdef DEBUG
|
2002-02-27 04:14:16 +00:00
|
|
|
/* added by SPK for memory cleanup, gracefully return our malloc()s */
|
2002-07-19 01:08:59 +00:00
|
|
|
void thanks_for_all_the_fish(void)
|
2002-02-27 04:14:16 +00:00
|
|
|
{
|
2003-01-13 01:35:15 +00:00
|
|
|
#ifndef DISABLE_JUSTIFY
|
|
|
|
if (quotestr != NULL)
|
|
|
|
free(quotestr);
|
|
|
|
#endif
|
2002-03-28 01:59:34 +00:00
|
|
|
#ifndef DISABLE_OPERATINGDIR
|
2002-02-27 04:14:16 +00:00
|
|
|
if (operating_dir != NULL)
|
|
|
|
free(operating_dir);
|
|
|
|
if (full_operating_dir != NULL)
|
|
|
|
free(full_operating_dir);
|
|
|
|
#endif
|
|
|
|
if (last_search != NULL)
|
|
|
|
free(last_search);
|
|
|
|
if (last_replace != NULL)
|
|
|
|
free(last_replace);
|
|
|
|
if (hblank != NULL)
|
|
|
|
free(hblank);
|
|
|
|
#ifndef DISABLE_SPELLER
|
|
|
|
if (alt_speller != NULL)
|
|
|
|
free(alt_speller);
|
|
|
|
#endif
|
2002-09-06 20:35:28 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2002-02-27 04:14:16 +00:00
|
|
|
if (help_text != NULL)
|
|
|
|
free(help_text);
|
2002-09-06 20:35:28 +00:00
|
|
|
#endif
|
2002-02-27 04:14:16 +00:00
|
|
|
if (filename != NULL)
|
|
|
|
free(filename);
|
|
|
|
if (answer != NULL)
|
|
|
|
free(answer);
|
|
|
|
if (cutbuffer != NULL)
|
2003-01-13 01:35:15 +00:00
|
|
|
free_filestruct(cutbuffer);
|
2002-02-27 04:14:16 +00:00
|
|
|
|
|
|
|
free_shortcutage(&main_list);
|
|
|
|
free_shortcutage(&whereis_list);
|
|
|
|
free_shortcutage(&replace_list);
|
|
|
|
free_shortcutage(&replace_list_2);
|
2002-07-19 01:08:59 +00:00
|
|
|
free_shortcutage(&goto_list);
|
2002-02-27 04:14:16 +00:00
|
|
|
free_shortcutage(&writefile_list);
|
|
|
|
free_shortcutage(&insertfile_list);
|
2003-01-13 01:35:15 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2002-07-19 01:08:59 +00:00
|
|
|
free_shortcutage(&help_list);
|
2003-01-13 01:35:15 +00:00
|
|
|
#endif
|
|
|
|
#ifndef DISABLE_SPELLER
|
2002-02-27 04:14:16 +00:00
|
|
|
free_shortcutage(&spell_list);
|
2003-01-13 01:35:15 +00:00
|
|
|
#endif
|
2002-07-19 01:08:59 +00:00
|
|
|
#ifndef NANO_SMALL
|
|
|
|
free_shortcutage(&extcmd_list);
|
|
|
|
#endif
|
2002-02-27 04:14:16 +00:00
|
|
|
#ifndef DISABLE_BROWSER
|
|
|
|
free_shortcutage(&browser_list);
|
2003-01-13 01:35:15 +00:00
|
|
|
free_shortcutage(&gotodir_list);
|
2002-02-27 04:14:16 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef NANO_SMALL
|
|
|
|
free_toggles();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
2002-04-10 02:31:20 +00:00
|
|
|
if (open_files != NULL) {
|
2002-05-12 19:52:15 +00:00
|
|
|
/* We free the memory associated with each open file. */
|
2003-02-03 02:56:44 +00:00
|
|
|
while (open_files->prev != NULL)
|
|
|
|
open_files = open_files->prev;
|
2002-07-19 01:08:59 +00:00
|
|
|
free_openfilestruct(open_files);
|
2003-02-03 02:56:44 +00:00
|
|
|
}
|
2002-04-10 02:31:20 +00:00
|
|
|
#else
|
2003-02-03 02:56:44 +00:00
|
|
|
free_filestruct(fileage);
|
2002-04-10 02:31:20 +00:00
|
|
|
#endif
|
2002-07-19 01:08:59 +00:00
|
|
|
|
|
|
|
#ifdef ENABLE_COLOR
|
|
|
|
free(syntaxstr);
|
|
|
|
while (syntaxes != NULL) {
|
|
|
|
syntaxtype *bill = syntaxes;
|
|
|
|
|
|
|
|
free(syntaxes->desc);
|
|
|
|
while (syntaxes->extensions != NULL) {
|
|
|
|
exttype *bob = syntaxes->extensions;
|
|
|
|
|
|
|
|
syntaxes->extensions = bob->next;
|
2003-01-13 01:35:15 +00:00
|
|
|
regfree(&bob->val);
|
2002-07-19 01:08:59 +00:00
|
|
|
free(bob);
|
|
|
|
}
|
|
|
|
while (syntaxes->color != NULL) {
|
|
|
|
colortype *bob = syntaxes->color;
|
|
|
|
|
|
|
|
syntaxes->color = bob->next;
|
2003-01-13 01:35:15 +00:00
|
|
|
regfree(&bob->start);
|
|
|
|
if (bob->end != NULL)
|
2003-02-03 02:56:44 +00:00
|
|
|
regfree(bob->end);
|
|
|
|
free(bob->end);
|
2002-07-19 01:08:59 +00:00
|
|
|
free(bob);
|
|
|
|
}
|
|
|
|
syntaxes = syntaxes->next;
|
|
|
|
free(bill);
|
|
|
|
}
|
|
|
|
#endif /* ENABLE_COLOR */
|
2003-01-05 20:41:21 +00:00
|
|
|
#ifndef NANO_SMALL
|
|
|
|
/* free history lists */
|
|
|
|
free_history(&search_history);
|
|
|
|
free_history(&replace_history);
|
|
|
|
#endif
|
2002-02-27 04:14:16 +00:00
|
|
|
}
|
2002-05-12 19:52:15 +00:00
|
|
|
#endif /* DEBUG */
|