blob: 7cad4150591f5cc96c398d237b1af707859bcc86 [file] [log] [blame]
Chris Allegretta11b00112000-08-06 21:13:45 +00001/* $Id$ */
Chris Allegrettaa2ea1932000-06-06 05:53:49 +00002/**************************************************************************
3 * global.c *
4 * *
5 * Copyright (C) 1999 Chris Allegretta *
6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation; either version 1, or (at your option) *
9 * any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program; if not, write to the Free Software *
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
19 * *
20 **************************************************************************/
21
22#include <sys/stat.h>
23#include "config.h"
24#include "nano.h"
25#include "proto.h"
26
27#ifndef NANO_SMALL
28#include <libintl.h>
29#define _(string) gettext(string)
30#else
31#define _(string) (string)
32#endif
33
34/*
35 * Global variables
36 */
37int flags = 0; /* Our new flag containig many options */
38int center_x = 0, center_y = 0; /* Center of screen */
39WINDOW *edit; /* The file portion of the editor */
40WINDOW *topwin; /* Top line of screen */
41WINDOW *bottomwin; /* Bottom buffer */
Chris Allegretta756f2202000-09-01 13:32:47 +000042char filename[PATH_MAX]; /* Name of the file */
Chris Allegrettaa2ea1932000-06-06 05:53:49 +000043int editwinrows = 0; /* How many rows long is the edit
44 window? */
45filestruct *current; /* Current buffer pointer */
46int current_x = 0, current_y = 0; /* Current position of X and Y in
47 the editor - relative to edit
48 window (0,0) */
49filestruct *fileage = NULL; /* Our file buffer */
50filestruct *edittop = NULL; /* Pointer to the top of the edit
51 buffer with respect to the
52 file struct */
53filestruct *editbot = NULL; /* Same for the bottom */
54filestruct *filebot = NULL; /* Last node in the file struct */
55filestruct *cutbuffer = NULL; /* A place to store cut text */
56
Chris Allegretta31925e42000-11-02 04:40:39 +000057char *answer = NULL; /* Answer str to many questions */
Chris Allegrettaa2ea1932000-06-06 05:53:49 +000058int totlines = 0; /* Total number of lines in the file */
59int totsize = 0; /* Total number of bytes in the file */
60int placewewant = 0; /* The collum we'd like the cursor
61 to jump to when we go to the
62 next or previous line */
63
Chris Allegretta6d690a32000-08-03 22:51:21 +000064int tabsize = 8; /* Our internal tabsize variable */
65
Chris Allegrettaa2ea1932000-06-06 05:53:49 +000066char *hblank; /* A horizontal blank line */
67char *help_text; /* The text in the help window */
68
69/* More stuff for the marker select */
70
71filestruct *mark_beginbuf; /* the begin marker buffer */
72int mark_beginx; /* X value in the string to start */
73
74shortcut main_list[MAIN_LIST_LEN];
75shortcut whereis_list[WHEREIS_LIST_LEN];
76shortcut replace_list[REPLACE_LIST_LEN];
Chris Allegretta105da332000-10-31 05:10:10 +000077shortcut replace_list_2[REPLACE_LIST_LEN]; /* 2nd half of replace dialog */
Chris Allegrettaa2ea1932000-06-06 05:53:49 +000078shortcut goto_list[GOTO_LIST_LEN];
79shortcut writefile_list[WRITEFILE_LIST_LEN];
80shortcut help_list[HELP_LIST_LEN];
81shortcut spell_list[SPELL_LIST_LEN];
Chris Allegretta756f2202000-09-01 13:32:47 +000082toggle toggles[TOGGLE_LEN];
Chris Allegrettaa2ea1932000-06-06 05:53:49 +000083
Chris Allegretta9fc8d432000-07-07 01:49:52 +000084/* Regular expressions */
85
Chris Allegretta805c26d2000-09-06 13:39:17 +000086#ifdef HAVE_REGEX_H
Chris Allegrettabd9e7c32000-10-26 01:44:42 +000087regex_t search_regexp; /* Global to store compiled search regexp */
88regmatch_t regmatches[10]; /* Match positions for parenthetical
89 subexpressions, max of 10 */
Chris Allegretta805c26d2000-09-06 13:39:17 +000090#endif
Chris Allegretta9fc8d432000-07-07 01:49:52 +000091
Chris Allegrettaa2ea1932000-06-06 05:53:49 +000092/* Initialize a struct *without* our lovely braces =( */
93void sc_init_one(shortcut * s, int key, char *desc, char *help, int alt,
94 int misc1, int misc2, int view, int (*func) (void))
95{
96 s->val = key;
97 s->desc = desc;
98 s->help = help;
99 s->altval = alt;
100 s->misc1 = misc1;
101 s->misc2 = misc2;
102 s->viewok = view;
103 s->func = func;
104}
105
Chris Allegretta756f2202000-09-01 13:32:47 +0000106/* Initialize the toggles in the same manner */
107void toggle_init_one(toggle * t, int val, char *desc, int flag)
108{
109 t->val = val;
110 t->desc = desc;
111 t->flag = flag;
112}
113
114void toggle_init(void)
115{
116#ifndef NANO_SMALL
117 char *toggle_const_msg, *toggle_autoindent_msg, *toggle_suspend_msg,
118 *toggle_nohelp_msg, *toggle_picomode_msg, *toggle_mouse_msg,
Chris Allegrettad7934d42000-10-03 05:39:29 +0000119 *toggle_cuttoend_msg, *toggle_wrap_msg;
120#ifdef HAVE_REGEX_H
Chris Allegrettabd9e7c32000-10-26 01:44:42 +0000121 char *toggle_regexp_msg;
Chris Allegrettad7934d42000-10-03 05:39:29 +0000122#endif
Chris Allegretta756f2202000-09-01 13:32:47 +0000123
124 toggle_const_msg = _("Constant cursor position");
Chris Allegrettaf8163dc2000-09-03 01:06:40 +0000125 toggle_autoindent_msg = _("Auto indent");
Chris Allegretta756f2202000-09-01 13:32:47 +0000126 toggle_suspend_msg = _("Suspend");
Chris Allegrettaf0f63a82000-09-02 18:44:21 +0000127 toggle_nohelp_msg = _("Help mode");
Chris Allegrettabf9a8cc2000-11-17 01:37:39 +0000128 toggle_picomode_msg = _("Pico mode");
Chris Allegretta756f2202000-09-01 13:32:47 +0000129 toggle_mouse_msg = _("Mouse support");
130 toggle_cuttoend_msg = _("Cut to end");
Chris Allegretta805c26d2000-09-06 13:39:17 +0000131#ifdef HAVE_REGEX_H
Chris Allegrettabd9e7c32000-10-26 01:44:42 +0000132 toggle_regexp_msg = _("Regular expressions");
Chris Allegretta805c26d2000-09-06 13:39:17 +0000133#endif
Chris Allegrettaf0f63a82000-09-02 18:44:21 +0000134 toggle_wrap_msg = _("Auto wrap");
Chris Allegretta756f2202000-09-01 13:32:47 +0000135
Chris Allegrettabd9e7c32000-10-26 01:44:42 +0000136 toggle_init_one(&toggles[0], TOGGLE_CONST_KEY, toggle_const_msg,
137 CONSTUPDATE);
138 toggle_init_one(&toggles[1], TOGGLE_AUTOINDENT_KEY,
139 toggle_autoindent_msg, AUTOINDENT);
140 toggle_init_one(&toggles[2], TOGGLE_SUSPEND_KEY, toggle_suspend_msg,
141 SUSPEND);
142 toggle_init_one(&toggles[3], TOGGLE_NOHELP_KEY, toggle_nohelp_msg,
143 NO_HELP);
144 toggle_init_one(&toggles[4], TOGGLE_PICOMODE_KEY, toggle_picomode_msg,
Chris Allegrettabf9a8cc2000-11-17 01:37:39 +0000145 PICO_MODE);
Chris Allegrettabd9e7c32000-10-26 01:44:42 +0000146 toggle_init_one(&toggles[5], TOGGLE_WRAP_KEY, toggle_wrap_msg,
147 NO_WRAP);
148 toggle_init_one(&toggles[6], TOGGLE_MOUSE_KEY, toggle_mouse_msg,
149 USE_MOUSE);
150 toggle_init_one(&toggles[7], TOGGLE_CUTTOEND_KEY, toggle_cuttoend_msg,
151 CUT_TO_END);
Chris Allegretta805c26d2000-09-06 13:39:17 +0000152#ifdef HAVE_REGEX_H
Chris Allegrettabd9e7c32000-10-26 01:44:42 +0000153 toggle_init_one(&toggles[8], TOGGLE_REGEXP_KEY, toggle_regexp_msg,
154 USE_REGEXP);
Chris Allegretta756f2202000-09-01 13:32:47 +0000155#endif
Chris Allegretta805c26d2000-09-06 13:39:17 +0000156#endif
Chris Allegretta756f2202000-09-01 13:32:47 +0000157}
158
Chris Allegrettaa2ea1932000-06-06 05:53:49 +0000159void shortcut_init(void)
160{
161 char *nano_help_msg = "", *nano_writeout_msg = "", *nano_exit_msg = "",
162 *nano_goto_msg = "", *nano_justify_msg = "", *nano_replace_msg =
163 "", *nano_insert_msg = "", *nano_whereis_msg =
164 "", *nano_prevpage_msg = "", *nano_nextpage_msg =
165 "", *nano_cut_msg = "", *nano_uncut_msg = "", *nano_cursorpos_msg =
166 "", *nano_spell_msg = "", *nano_up_msg = "", *nano_down_msg =
167 "", *nano_forward_msg = "", *nano_back_msg = "", *nano_home_msg =
168 "", *nano_end_msg = "", *nano_firstline_msg =
169 "", *nano_lastline_msg = "", *nano_refresh_msg =
170 "", *nano_mark_msg = "", *nano_delete_msg =
171 "", *nano_backspace_msg = "", *nano_tab_msg =
172 "", *nano_enter_msg = "", *nano_case_msg =
Chris Allegretta4d29be12000-10-31 05:32:09 +0000173 "", *nano_cancel_msg = "";
Chris Allegrettaa2ea1932000-06-06 05:53:49 +0000174
175#ifndef NANO_SMALL
176 nano_help_msg = _("Invoke the help menu");
177 nano_writeout_msg = _("Write the current file to disk");
178 nano_exit_msg = _("Exit from nano");
179 nano_goto_msg = _("Goto a specific line number");
180 nano_justify_msg = _("Justify the current paragraph");
181 nano_replace_msg = _("Replace text within the editor");
182 nano_insert_msg = _("Insert another file into the current one");
183 nano_whereis_msg = _("Search for text within the editor");
184 nano_prevpage_msg = _("Move to the previous screen");
185 nano_nextpage_msg = _("Move to the next screen");
186 nano_cut_msg = _("Cut the current line and store it in the cutbuffer");
187 nano_uncut_msg = _("Uncut from the cutbuffer into the current line");
188 nano_cursorpos_msg = _("Show the posititon of the cursor");
189 nano_spell_msg = _("Invoke the spell checker (if available)");
190 nano_up_msg = _("Move up one line");
191 nano_down_msg = _("Move down one line");
192 nano_forward_msg = _("Move forward one character");
193 nano_back_msg = _("Move back one character");
194 nano_home_msg = _("Move to the beginning of the current line");
195 nano_end_msg = _("Move to the end of the current line");
196 nano_firstline_msg = _("Go to the first line of the file");
197 nano_lastline_msg = _("Go to the last line of the file");
198 nano_refresh_msg = _("Refresh (redraw) the current screen");
199 nano_mark_msg = _("Mark text at the current cursor location");
200 nano_delete_msg = _("Delete the character under the cursor");
201 nano_backspace_msg =
202 _("Delete the character to the left of the cursor");
203 nano_tab_msg = _("Insert a tab character");
204 nano_enter_msg = _("Insert a carriage return at the cursor position");
205 nano_case_msg =
206 _("Make the current search or replace case (in)sensitive");
207 nano_cancel_msg = _("Cancel the current function");
208#endif
209
Chris Allegrettabf9a8cc2000-11-17 01:37:39 +0000210 if (ISSET(PICO_MODE))
Chris Allegrettaa2ea1932000-06-06 05:53:49 +0000211 sc_init_one(&main_list[0], NANO_HELP_KEY, _("Get Help"),
Chris Allegretta16e41682000-09-11 22:33:54 +0000212 nano_help_msg, 0, NANO_HELP_FKEY, 0, VIEW, do_help);
Chris Allegrettaa2ea1932000-06-06 05:53:49 +0000213 else
214 sc_init_one(&main_list[0], NANO_WRITEOUT_KEY, _("WriteOut"),
215 nano_writeout_msg,
216 0, NANO_WRITEOUT_FKEY, 0, NOVIEW, do_writeout_void);
217
218 sc_init_one(&main_list[1], NANO_EXIT_KEY, _("Exit"),
219 nano_exit_msg, 0, NANO_EXIT_FKEY, 0, VIEW, do_exit);
220
Chris Allegrettabf9a8cc2000-11-17 01:37:39 +0000221 if (ISSET(PICO_MODE))
Chris Allegrettaa2ea1932000-06-06 05:53:49 +0000222 sc_init_one(&main_list[2], NANO_WRITEOUT_KEY, _("WriteOut"),
223 nano_writeout_msg,
224 0, NANO_WRITEOUT_FKEY, 0, NOVIEW, do_writeout_void);
225 else
226 sc_init_one(&main_list[2], NANO_GOTO_KEY, _("Goto Line"),
227 nano_goto_msg,
228 NANO_ALT_G, NANO_GOTO_FKEY, 0, VIEW, do_gotoline_void);
229
Chris Allegrettabf9a8cc2000-11-17 01:37:39 +0000230 if (ISSET(PICO_MODE))
Chris Allegrettaa2ea1932000-06-06 05:53:49 +0000231 sc_init_one(&main_list[3], NANO_JUSTIFY_KEY, _("Justify"),
Chris Allegrettabd9e7c32000-10-26 01:44:42 +0000232 nano_justify_msg, 0, NANO_JUSTIFY_FKEY, 0,
Chris Allegretta16e41682000-09-11 22:33:54 +0000233 NOVIEW, do_justify);
Chris Allegrettaa2ea1932000-06-06 05:53:49 +0000234 else
235 sc_init_one(&main_list[3], NANO_REPLACE_KEY, _("Replace"),
236 nano_replace_msg,
237 NANO_ALT_R, NANO_REPLACE_FKEY, 0, NOVIEW, do_replace);
238
239 sc_init_one(&main_list[4], NANO_INSERTFILE_KEY, _("Read File"),
240 nano_insert_msg,
241 0, NANO_INSERTFILE_FKEY, 0, NOVIEW, do_insertfile);
242
243 sc_init_one(&main_list[5], NANO_WHEREIS_KEY, _("Where Is"),
244 nano_whereis_msg,
245 0, NANO_WHEREIS_FKEY, 0, VIEW, do_search);
246
247 sc_init_one(&main_list[6], NANO_PREVPAGE_KEY, _("Prev Page"),
248 nano_prevpage_msg,
249 0, NANO_PREVPAGE_FKEY, KEY_PPAGE, VIEW, page_up);
250
251 sc_init_one(&main_list[7], NANO_NEXTPAGE_KEY, _("Next Page"),
252 nano_nextpage_msg,
253 0, NANO_NEXTPAGE_FKEY, KEY_NPAGE, VIEW, page_down);
254
255 sc_init_one(&main_list[8], NANO_CUT_KEY, _("Cut Text"),
256 nano_cut_msg, 0, NANO_CUT_FKEY, 0, NOVIEW, do_cut_text);
257
258 sc_init_one(&main_list[9], NANO_UNCUT_KEY, _("UnCut Txt"),
259 nano_uncut_msg,
260 0, NANO_UNCUT_FKEY, 0, NOVIEW, do_uncut_text);
261
262 sc_init_one(&main_list[10], NANO_CURSORPOS_KEY, _("Cur Pos"),
263 nano_cursorpos_msg,
264 0, NANO_CURSORPOS_FKEY, 0, VIEW, do_cursorpos);
265
266 sc_init_one(&main_list[11], NANO_SPELL_KEY, _("To Spell"),
267 nano_spell_msg, 0, NANO_SPELL_FKEY, 0, NOVIEW, do_spell);
268
269
270 sc_init_one(&main_list[12], NANO_UP_KEY, _("Up"),
271 nano_up_msg, 0, KEY_UP, 0, VIEW, do_up);
272
273 sc_init_one(&main_list[13], NANO_DOWN_KEY, _("Down"),
274 nano_down_msg, 0, KEY_DOWN, 0, VIEW, do_down);
275
276 sc_init_one(&main_list[14], NANO_FORWARD_KEY, _("Forward"),
277 nano_forward_msg, 0, KEY_RIGHT, 0, VIEW, do_right);
278
279 sc_init_one(&main_list[15], NANO_BACK_KEY, _("Back"),
280 nano_back_msg, 0, KEY_LEFT, 0, VIEW, do_left);
281
282 sc_init_one(&main_list[16], NANO_HOME_KEY, _("Home"),
283 nano_home_msg, 0, KEY_HOME, 362, VIEW, do_home);
284
285 sc_init_one(&main_list[17], NANO_END_KEY, _("End"),
286 nano_end_msg, 0, KEY_END, 385, VIEW, do_end);
287
288 sc_init_one(&main_list[18], NANO_REFRESH_KEY, _("Refresh"),
289 nano_refresh_msg, 0, 0, 0, VIEW, total_refresh);
290
291 sc_init_one(&main_list[19], NANO_MARK_KEY, _("Mark Text"),
292 nano_mark_msg, 0, 0, 0, NOVIEW, do_mark);
293
294 sc_init_one(&main_list[20], NANO_DELETE_KEY, _("Delete"),
295 nano_delete_msg, 0, KEY_DC,
296 NANO_CONTROL_D, NOVIEW, do_delete);
297
298 sc_init_one(&main_list[21], NANO_BACKSPACE_KEY, _("Backspace"),
299 nano_backspace_msg, 0,
300 KEY_BACKSPACE, 127, NOVIEW, do_backspace);
301
302 sc_init_one(&main_list[22], NANO_TAB_KEY, _("Tab"),
303 nano_tab_msg, 0, 0, 0, NOVIEW, do_tab);
304
Chris Allegrettabf9a8cc2000-11-17 01:37:39 +0000305 if (ISSET(PICO_MODE))
Chris Allegrettaa2ea1932000-06-06 05:53:49 +0000306 sc_init_one(&main_list[23], NANO_REPLACE_KEY, _("Replace"),
307 nano_replace_msg,
308 NANO_ALT_R, NANO_REPLACE_FKEY, 0, NOVIEW, do_replace);
309 else
310 sc_init_one(&main_list[23], NANO_JUSTIFY_KEY, _("Justify"),
Chris Allegrettabd9e7c32000-10-26 01:44:42 +0000311 nano_justify_msg, 0, NANO_JUSTIFY_FKEY, 0,
Chris Allegretta16e41682000-09-11 22:33:54 +0000312 NOVIEW, do_justify);
Chris Allegrettaa2ea1932000-06-06 05:53:49 +0000313
314 sc_init_one(&main_list[24], NANO_ENTER_KEY, _("Enter"),
315 nano_enter_msg,
316 0, KEY_ENTER, NANO_CONTROL_M, NOVIEW, do_enter_void);
317
Chris Allegrettabf9a8cc2000-11-17 01:37:39 +0000318 if (ISSET(PICO_MODE))
Chris Allegrettaa2ea1932000-06-06 05:53:49 +0000319 sc_init_one(&main_list[25], NANO_GOTO_KEY, _("Goto Line"),
320 nano_goto_msg,
321 NANO_ALT_G, NANO_GOTO_FKEY, 0, VIEW, do_gotoline_void);
322 else
323 sc_init_one(&main_list[25], NANO_HELP_KEY, _("Get Help"),
Chris Allegretta16e41682000-09-11 22:33:54 +0000324 nano_help_msg, 0, NANO_HELP_FKEY, 0, VIEW, do_help);
Chris Allegrettaa2ea1932000-06-06 05:53:49 +0000325
326
327 sc_init_one(&whereis_list[0], NANO_FIRSTLINE_KEY, _("First Line"),
328 nano_firstline_msg, 0, 0, 0, VIEW, do_first_line);
329
330 sc_init_one(&whereis_list[1], NANO_LASTLINE_KEY, _("Last Line"),
331 nano_lastline_msg, 0, 0, 0, VIEW, do_last_line);
332
333 sc_init_one(&whereis_list[2], NANO_CASE_KEY, _("Case Sens"),
334 nano_case_msg, 0, 0, 0, VIEW, 0);
335
336
Chris Allegretta715e7dd2000-06-30 20:35:26 +0000337 sc_init_one(&whereis_list[3], NANO_OTHERSEARCH_KEY, _("Replace"),
Chris Allegrettaa2ea1932000-06-06 05:53:49 +0000338 nano_replace_msg, 0, 0, 0, VIEW, do_replace);
339
Chris Allegrettabd9e7c32000-10-26 01:44:42 +0000340 sc_init_one(&whereis_list[4], NANO_FROMSEARCHTOGOTO_KEY,
341 _("Goto Line"), nano_goto_msg, 0, 0, 0, VIEW,
342 do_gotoline_void);
Chris Allegretta8c2b40f2000-06-29 01:30:04 +0000343
344 sc_init_one(&whereis_list[5], NANO_CANCEL_KEY, _("Cancel"),
Chris Allegrettaa2ea1932000-06-06 05:53:49 +0000345 nano_cancel_msg, 0, 0, 0, VIEW, 0);
346
347
348 sc_init_one(&replace_list[0], NANO_FIRSTLINE_KEY, _("First Line"),
349 nano_firstline_msg, 0, 0, 0, VIEW, do_first_line);
350
351 sc_init_one(&replace_list[1], NANO_LASTLINE_KEY, _("Last Line"),
352 nano_lastline_msg, 0, 0, 0, VIEW, do_last_line);
353
354 sc_init_one(&replace_list[2], NANO_CASE_KEY, _("Case Sens"),
355 nano_case_msg, 0, 0, 0, VIEW, 0);
356
Chris Allegretta8c2b40f2000-06-29 01:30:04 +0000357 sc_init_one(&replace_list[3], NANO_OTHERSEARCH_KEY, _("No Replace"),
Chris Allegrettaa2ea1932000-06-06 05:53:49 +0000358 nano_whereis_msg, 0, 0, 0, VIEW, do_search);
359
Chris Allegrettabd9e7c32000-10-26 01:44:42 +0000360 sc_init_one(&replace_list[4], NANO_FROMSEARCHTOGOTO_KEY,
361 _("Goto Line"), nano_goto_msg, 0, 0, 0, VIEW,
362 do_gotoline_void);
Chris Allegretta8c2b40f2000-06-29 01:30:04 +0000363
Chris Allegretta105da332000-10-31 05:10:10 +0000364 sc_init_one(&replace_list[5], NANO_CANCEL_KEY, _("Cancel"),
365 nano_cancel_msg, 0, 0, 0, VIEW, 0);
366
367
368
369 sc_init_one(&replace_list_2[0], NANO_FIRSTLINE_KEY, _("First Line"),
370 nano_firstline_msg, 0, 0, 0, VIEW, do_first_line);
371
372 sc_init_one(&replace_list_2[1], NANO_LASTLINE_KEY, _("Last Line"),
373 nano_lastline_msg, 0, 0, 0, VIEW, do_last_line);
374
Chris Allegretta4d29be12000-10-31 05:32:09 +0000375 sc_init_one(&replace_list_2[2], NANO_CANCEL_KEY, _("Cancel"),
Chris Allegrettaa2ea1932000-06-06 05:53:49 +0000376 nano_cancel_msg, 0, 0, 0, VIEW, 0);
377
378
379 sc_init_one(&goto_list[0], NANO_FIRSTLINE_KEY, _("First Line"),
380 nano_firstline_msg, 0, 0, 0, VIEW, &do_first_line);
381
382 sc_init_one(&goto_list[1], NANO_LASTLINE_KEY, _("Last Line"),
383 nano_lastline_msg, 0, 0, 0, VIEW, &do_last_line);
384
385 sc_init_one(&goto_list[2], NANO_CANCEL_KEY, _("Cancel"),
386 nano_cancel_msg, 0, 0, 0, VIEW, 0);
387
388
389 sc_init_one(&help_list[0], NANO_PREVPAGE_KEY, _("Prev Page"),
390 nano_prevpage_msg,
391 0, NANO_PREVPAGE_FKEY, KEY_PPAGE, VIEW, page_up);
392
393 sc_init_one(&help_list[1], NANO_NEXTPAGE_KEY, _("Next Page"),
394 nano_nextpage_msg,
395 0, NANO_NEXTPAGE_FKEY, KEY_NPAGE, VIEW, page_down);
396
397 sc_init_one(&help_list[2], NANO_EXIT_KEY, _("Exit"),
398 nano_exit_msg, 0, NANO_EXIT_FKEY, 0, VIEW, do_exit);
399
400
401 sc_init_one(&writefile_list[0], NANO_CANCEL_KEY, _("Cancel"),
402 nano_cancel_msg, 0, 0, 0, VIEW, 0);
403
404
405 sc_init_one(&writefile_list[0], NANO_CANCEL_KEY, _("Cancel"),
406 nano_cancel_msg, 0, 0, 0, VIEW, 0);
407
408 sc_init_one(&spell_list[0], NANO_HELP_KEY, _("Get Help"),
409 nano_help_msg, 0, 0, 0, VIEW, do_help);
410
411 sc_init_one(&spell_list[1], NANO_CANCEL_KEY, _("Cancel"),
412 nano_cancel_msg, 0, 0, 0, VIEW, 0);
413
Chris Allegretta756f2202000-09-01 13:32:47 +0000414 toggle_init();
Chris Allegrettaa2ea1932000-06-06 05:53:49 +0000415}