nano.h 14.7 KB
Newer Older
Chris Allegretta's avatar
Chris Allegretta committed
1
/* $Id$ */
Chris Allegretta's avatar
Chris Allegretta committed
2
3
4
/**************************************************************************
 *   nano.h                                                               *
 *                                                                        *
5
 *   Copyright (C) 1999-2004 Chris Allegretta                             *
Chris Allegretta's avatar
Chris Allegretta committed
6
7
 *   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 *
8
 *   the Free Software Foundation; either version 2, or (at your option)  *
Chris Allegretta's avatar
Chris Allegretta committed
9
10
11
12
13
14
15
16
17
18
19
20
21
 *   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.            *
 *                                                                        *
 **************************************************************************/

David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
22
23
24
#ifndef NANO_H
#define NANO_H 1

Chris Allegretta's avatar
Chris Allegretta committed
25
26
27
28
29
30
31
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif

/* Macros for the flags int... */
#define SET(bit) flags |= bit
#define UNSET(bit) flags &= ~bit
32
#define ISSET(bit) ((flags & bit) != 0)
33
#define TOGGLE(bit) flags ^= bit
Chris Allegretta's avatar
Chris Allegretta committed
34

Chris Allegretta's avatar
Chris Allegretta committed
35
36
/* Define charalloc as a macro rather than duplicating code */
#define charalloc(howmuch) (char *)nmalloc((howmuch) * sizeof(char))
37
#define charealloc(ptr, howmuch) (char *)nrealloc(ptr, (howmuch) * sizeof(char))
38
#define charmove(dest, src, n) memmove(dest, src, (n) * sizeof(char))
39
40
41
#ifdef BROKEN_REGEXEC
#define regexec(preg, string, nmatch, pmatch, eflags) regexec_safe(preg, string, nmatch, pmatch, eflags)
#endif
Chris Allegretta's avatar
Chris Allegretta committed
42

43
#ifndef NANO_SMALL
44
45
/* For the backup file copy ... */
#define COPYFILEBLOCKSIZE 1024
46
#endif
Chris Allegretta's avatar
Chris Allegretta committed
47

48
#ifdef USE_SLANG
49
50
/* Slang support enabled.  Work around Slang's not defining KEY_DC or
 * KEY_IC. */
Chris Allegretta's avatar
Chris Allegretta committed
51
#include <slcurses.h>
52
#define KEY_DC SL_KEY_DELETE
53
#define KEY_IC SL_KEY_IC
Chris Allegretta's avatar
Chris Allegretta committed
54
55
#elif defined(HAVE_NCURSES_H)
#include <ncurses.h>
56
#else /* Uh oh. */
57
#include <curses.h>
Chris Allegretta's avatar
Chris Allegretta committed
58
59
#endif /* CURSES_H */

60
61
62
63
64
#ifdef ENABLE_NLS
#  ifdef HAVE_LIBINTL_H
#    include <libintl.h>
#  endif
#  define _(string) gettext(string)
65
#  define P_(singular, plural, number) ngettext(singular, plural, number)
66
67
#else
#  define _(string) (string)
68
#  define P_(singular, plural, number) (number == 1 ? singular : plural)
Chris Allegretta's avatar
Chris Allegretta committed
69
70
#endif

71
72
#include <sys/types.h>
#include <sys/stat.h>
Chris Allegretta's avatar
Chris Allegretta committed
73
74
#include "config.h"

75
/* If no snprintf()/vsnprintf(), use the versions from glib. */
Chris Allegretta's avatar
Chris Allegretta committed
76
77
78
#if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF)
#include <glib.h>
# ifndef HAVE_SNPRINTF
79
#  define snprintf g_snprintf
Chris Allegretta's avatar
Chris Allegretta committed
80
81
# endif
# ifndef HAVE_VSNPRINTF
82
#  define vsnprintf g_vsnprintf
Chris Allegretta's avatar
Chris Allegretta committed
83
84
85
# endif
#endif

86
/* If no strcasecmp()/strncasecmp(), use the versions we have. */
87
#ifndef HAVE_STRCASECMP
88
#define strcasecmp nstricmp
89
90
91
#endif

#ifndef HAVE_STRNCASECMP
92
#define strncasecmp nstrnicmp
93
94
#endif

David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
95
/* Assume ERR is defined as -1.  To avoid duplicate case values when
96
97
98
 * some key definitions are missing, we have to set all of these, and
 * all of the special sentinel values below, to different negative
 * values other than -1. */
99

100
/* HP-UX 10 & 11 do not seem to support KEY_HOME and KEY_END. */
101
#ifndef KEY_HOME
102
#define KEY_HOME -2
103
#endif
104
105

#ifndef KEY_END
106
#define KEY_END -3
107
108
#endif

109
/* Slang and SunOS 5.7-5.9 do not seem to support KEY_RESIZE. */
110
#ifndef KEY_RESIZE
111
#define KEY_RESIZE -4
112
113
#endif

David Lawrence Ramsey's avatar
   
David Lawrence Ramsey committed
114
/* Slang does not seem to support KEY_SUSPEND, KEY_SLEFT, or
115
 * KEY_SRIGHT. */
116
#ifndef KEY_SUSPEND
117
#define KEY_SUSPEND -5
118
#endif
119

David Lawrence Ramsey's avatar
   
David Lawrence Ramsey committed
120
121
#ifndef KEY_SLEFT
#define KEY_SLEFT -6
122
123
#endif

David Lawrence Ramsey's avatar
   
David Lawrence Ramsey committed
124
125
#ifndef KEY_SRIGHT
#define KEY_SRIGHT -7
126
#endif
127

Chris Allegretta's avatar
Chris Allegretta committed
128
#define VERMSG "GNU nano " VERSION
Chris Allegretta's avatar
Chris Allegretta committed
129

130
131
/* If we aren't using ncurses, turn the mouse support off, as it's
 * ncurses-specific. */
132
133
134
135
#ifndef NCURSES_MOUSE_VERSION
#define DISABLE_MOUSE 1
#endif

136
137
138
139
#if defined(DISABLE_WRAPPING) && defined(DISABLE_JUSTIFY)
#define DISABLE_WRAPJUSTIFY 1
#endif

140
/* Structure types. */
Chris Allegretta's avatar
Chris Allegretta committed
141
142
typedef struct filestruct {
    char *data;
143
144
145
    struct filestruct *next;	/* Next node. */
    struct filestruct *prev;	/* Previous node. */
    int lineno;			/* The line number. */
146
} filestruct;
147

148
#ifdef ENABLE_MULTIBUFFER
149
150
typedef struct openfilestruct {
    char *filename;
151
152
153
#ifndef NANO_SMALL
    struct stat originalfilestat;
#endif
154
155
156
157
    struct openfilestruct *next;	/* Next node. */
    struct openfilestruct *prev;	/* Previous node. */
    struct filestruct *fileage;	/* Current file. */
    struct filestruct *filebot;	/* Current file's last line. */
Chris Allegretta's avatar
Chris Allegretta committed
158
159
#ifndef NANO_SMALL
    struct filestruct *file_mark_beginbuf;
160
161
162
163
				/* Current file's beginning marked
				 * line. */
    int file_mark_beginx;	/* Current file's beginning marked
				 * line's x-coordinate position. */
Chris Allegretta's avatar
Chris Allegretta committed
164
#endif
165
166
167
168
    int file_current_x;		/* Current file's x-coordinate
				 * position. */
    int file_current_y;		/* Current file's y-coordinate
				 * position. */
Chris Allegretta's avatar
Chris Allegretta committed
169
    int file_flags;		/* Current file's flags: modification
170
171
172
173
174
175
176
				 * status (and marking status, if
				 * available). */
    int file_placewewant;	/* Current file's place we want. */
    int file_totlines;		/* Current file's total number of
				 * lines. */
    long file_totsize;		/* Current file's total size. */
    int file_lineno;		/* Current file's line number. */
177
} openfilestruct;
178
179
#endif

Chris Allegretta's avatar
Chris Allegretta committed
180
typedef struct shortcut {
181
    /* Key values that aren't used should be set to NANO_NO_KEY. */
David Lawrence Ramsey's avatar
   
David Lawrence Ramsey committed
182
    int val;		/* Special sentinel key or control key we want
183
184
185
186
			 * bound. */
    int metaval;		/* Meta key we want bound. */
    int func_key;	/* Function key we want bound. */
    int misc;		/* Other Meta key we want bound. */
David Lawrence Ramsey's avatar
   
David Lawrence Ramsey committed
187
    int viewok;		/* Is this function legal in view mode? */
188
189
    int (*func) (void);	/* Function to call when we catch this key. */
    const char *desc;	/* Description, e.g. "Page Up". */
190
#ifndef DISABLE_HELP
191
    const char *help;	/* Help file entry text. */
192
#endif
David Lawrence Ramsey's avatar
   
David Lawrence Ramsey committed
193
    struct shortcut *next;
Chris Allegretta's avatar
Chris Allegretta committed
194
195
} shortcut;

Chris Allegretta's avatar
Chris Allegretta committed
196
#ifndef NANO_SMALL
197
typedef struct toggle {
198
199
   int val;		/* Sequence to toggle the key.  Should only need
			 * one. */
200
   const char *desc;	/* Description for when toggle is, uh, toggled,
201
202
			 * e.g. "Cut to end"; we'll append Enabled or
			 * Disabled. */
203
   int flag;		/* What flag actually gets toggled. */
204
   struct toggle *next;
205
} toggle;
Chris Allegretta's avatar
Chris Allegretta committed
206
#endif /* !NANO_SMALL */
207

208
209
#ifdef ENABLE_NANORC
typedef struct rcoption {
210
   const char *name;
211
212
213
214
   int flag;
} rcoption;
#endif /* ENABLE_NANORC */

215
216
217
#ifdef ENABLE_COLOR

typedef struct colortype {
218
219
220
221
    int fg;			/* fg color */
    int bg;			/* bg color */
    int bright;			/* Is this color A_BOLD? */
    int pairnum;		/* Color pair number used for this fg/bg */
222
223
    regex_t start;		/* Start (or all) of the regex string */
    regex_t *end;		/* End of the regex string */
224
225
226
    struct colortype *next;
} colortype;

227
typedef struct exttype {
228
    regex_t val;		/* The extensions that match this syntax. */
229
230
231
232
233
    struct exttype *next;
} exttype;

typedef struct syntaxtype {
    char *desc;			/* Name of this syntax type */
Chris Allegretta's avatar
Chris Allegretta committed
234
    exttype *extensions;	/* List of extensions that this applies to */
235
236
237
238
    colortype *color;		/* color struct for this syntax */
    struct syntaxtype *next;
} syntaxtype;

239
240
#endif /* ENABLE_COLOR */

241
242
243
244
245
246
247
#ifndef NANO_SMALL
typedef struct historytype {
    struct historytype *next;
    struct historytype *prev;
    char *data;
} historytype;
typedef struct historyheadtype {
248
249
250
251
    struct historytype *next;	/* Keep *next and *prev members
				 * together. */
    struct historytype *prev;	/* And in same order as in
				 * historytype. */
252
253
254
255
256
257
    struct historytype *tail;
    struct historytype *current;
    int count;
    int len;
} historyheadtype;
#endif /* !NANO_SMALL */
258

259
260
/* Bitwise flags so we can save space (or more correctly, not waste
 * it). */
Chris Allegretta's avatar
Chris Allegretta committed
261
262
263
264
265
266
#define MODIFIED		(1<<0)
#define KEEP_CUTBUFFER		(1<<1)
#define CASE_SENSITIVE		(1<<2)
#define MARK_ISSET		(1<<3)
#define CONSTUPDATE		(1<<4)
#define NO_HELP			(1<<5)
267
268
269
270
#define NOFOLLOW_SYMLINKS	(1<<6)
#define SUSPEND			(1<<7)
#define NO_WRAP			(1<<8)
#define AUTOINDENT		(1<<9)
271
272
273
274
275
276
277
278
279
280
281
#define VIEW_MODE		(1<<10)
#define USE_MOUSE		(1<<11)
#define USE_REGEXP		(1<<12)
#define REGEXP_COMPILED		(1<<13)
#define TEMP_OPT		(1<<14)
#define CUT_TO_END		(1<<15)
#define REVERSE_SEARCH		(1<<16)
#define MULTIBUFFER		(1<<17)
#define DOS_FILE		(1<<18)
#define MAC_FILE		(1<<19)
#define SMOOTHSCROLL		(1<<20)
282
#define DISABLE_CURPOS		(1<<21)	/* Damn, we still need it. */
283
284
285
286
287
288
289
290
291
#define REBIND_DELETE		(1<<22)
#define NO_CONVERT		(1<<23)
#define BACKUP_FILE		(1<<24)
#define NO_RCFILE		(1<<25)
#define COLOR_SYNTAX		(1<<26)
#define PRESERVE		(1<<27)
#define HISTORY_CHANGED		(1<<28)
#define HISTORYLOG		(1<<29)
#define JUSTIFY_MODE		(1<<30)
Chris Allegretta's avatar
Chris Allegretta committed
292

293
/* Control key sequences, changing these would be very very bad. */
Chris Allegretta's avatar
Chris Allegretta committed
294
#define NANO_CONTROL_SPACE 0
Chris Allegretta's avatar
Chris Allegretta committed
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
#define NANO_CONTROL_A 1
#define NANO_CONTROL_B 2
#define NANO_CONTROL_C 3
#define NANO_CONTROL_D 4
#define NANO_CONTROL_E 5
#define NANO_CONTROL_F 6
#define NANO_CONTROL_G 7
#define NANO_CONTROL_H 8
#define NANO_CONTROL_I 9
#define NANO_CONTROL_J 10
#define NANO_CONTROL_K 11
#define NANO_CONTROL_L 12
#define NANO_CONTROL_M 13
#define NANO_CONTROL_N 14
#define NANO_CONTROL_O 15
#define NANO_CONTROL_P 16
#define NANO_CONTROL_Q 17
#define NANO_CONTROL_R 18
#define NANO_CONTROL_S 19
#define NANO_CONTROL_T 20
#define NANO_CONTROL_U 21
#define NANO_CONTROL_V 22
#define NANO_CONTROL_W 23
#define NANO_CONTROL_X 24
#define NANO_CONTROL_Y 25
#define NANO_CONTROL_Z 26
321
#define NANO_CONTROL_3 27
Chris Allegretta's avatar
Chris Allegretta committed
322
323
324
325
#define NANO_CONTROL_4 28
#define NANO_CONTROL_5 29
#define NANO_CONTROL_6 30
#define NANO_CONTROL_7 31
326
#define NANO_CONTROL_8 127
Chris Allegretta's avatar
Chris Allegretta committed
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353

#define NANO_ALT_A 'a'
#define NANO_ALT_B 'b'
#define NANO_ALT_C 'c'
#define NANO_ALT_D 'd'
#define NANO_ALT_E 'e'
#define NANO_ALT_F 'f'
#define NANO_ALT_G 'g'
#define NANO_ALT_H 'h'
#define NANO_ALT_I 'i'
#define NANO_ALT_J 'j'
#define NANO_ALT_K 'k'
#define NANO_ALT_L 'l'
#define NANO_ALT_M 'm'
#define NANO_ALT_N 'n'
#define NANO_ALT_O 'o'
#define NANO_ALT_P 'p'
#define NANO_ALT_Q 'q'
#define NANO_ALT_R 'r'
#define NANO_ALT_S 's'
#define NANO_ALT_T 't'
#define NANO_ALT_U 'u'
#define NANO_ALT_V 'v'
#define NANO_ALT_W 'w'
#define NANO_ALT_X 'x'
#define NANO_ALT_Y 'y'
#define NANO_ALT_Z 'z'
354
355
#define NANO_ALT_PERIOD '.'
#define NANO_ALT_COMMA ','
356
357
#define NANO_ALT_LCARAT '<'
#define NANO_ALT_RCARAT '>'
358
#define NANO_ALT_RBRACKET ']'
359
#define NANO_ALT_SPACE ' '
Chris Allegretta's avatar
Chris Allegretta committed
360

361
362
/* Some semi-changeable keybindings; don't play with these unless you're
 * sure you know what you're doing. */
Chris Allegretta's avatar
Chris Allegretta committed
363

David Lawrence Ramsey's avatar
   
David Lawrence Ramsey committed
364
365
366
/* No key at all. */
#define NANO_NO_KEY		-8

367
/* Special sentinel key used for search string history. */
David Lawrence Ramsey's avatar
   
David Lawrence Ramsey committed
368
369
370
#define NANO_HISTORY_KEY	-9

/* Normal keys. */
Chris Allegretta's avatar
Chris Allegretta committed
371
372
#define NANO_INSERTFILE_KEY	NANO_CONTROL_R
#define NANO_INSERTFILE_FKEY	KEY_F(5)
David Lawrence Ramsey's avatar
   
David Lawrence Ramsey committed
373
374
#define NANO_EXIT_KEY		NANO_CONTROL_X
#define NANO_EXIT_FKEY		KEY_F(2)
Chris Allegretta's avatar
Chris Allegretta committed
375
376
377
378
379
380
381
382
383
#define NANO_WRITEOUT_KEY	NANO_CONTROL_O
#define NANO_WRITEOUT_FKEY	KEY_F(3)
#define NANO_GOTO_KEY		NANO_CONTROL_7
#define NANO_GOTO_FKEY		KEY_F(13)
#define NANO_ALT_GOTO_KEY	NANO_ALT_G
#define NANO_HELP_KEY		NANO_CONTROL_G
#define NANO_HELP_FKEY		KEY_F(1)
#define NANO_WHEREIS_KEY	NANO_CONTROL_W
#define NANO_WHEREIS_FKEY	KEY_F(6)
384
#define NANO_WHEREIS_NEXT_KEY	NANO_ALT_W
Chris Allegretta's avatar
Chris Allegretta committed
385
386
387
#define NANO_REPLACE_KEY	NANO_CONTROL_4
#define NANO_REPLACE_FKEY	KEY_F(14)
#define NANO_ALT_REPLACE_KEY	NANO_ALT_R
388
#define NANO_OTHERSEARCH_KEY	NANO_CONTROL_R
Chris Allegretta's avatar
Chris Allegretta committed
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
#define NANO_PREVPAGE_KEY	NANO_CONTROL_Y
#define NANO_PREVPAGE_FKEY	KEY_F(7)
#define NANO_NEXTPAGE_KEY	NANO_CONTROL_V
#define NANO_NEXTPAGE_FKEY	KEY_F(8)
#define NANO_CUT_KEY		NANO_CONTROL_K
#define NANO_CUT_FKEY		KEY_F(9)
#define NANO_UNCUT_KEY		NANO_CONTROL_U
#define NANO_UNCUT_FKEY		KEY_F(10)
#define NANO_CURSORPOS_KEY	NANO_CONTROL_C
#define NANO_CURSORPOS_FKEY	KEY_F(11)
#define NANO_SPELL_KEY		NANO_CONTROL_T
#define NANO_SPELL_FKEY		KEY_F(12)
#define NANO_FIRSTLINE_KEY	NANO_PREVPAGE_KEY
#define NANO_LASTLINE_KEY	NANO_NEXTPAGE_KEY
#define NANO_CANCEL_KEY		NANO_CONTROL_C
#define NANO_REFRESH_KEY	NANO_CONTROL_L
#define NANO_JUSTIFY_KEY	NANO_CONTROL_J
#define NANO_JUSTIFY_FKEY	KEY_F(4)
407
408
#define NANO_UNJUSTIFY_KEY	NANO_UNCUT_KEY	/* Same key as uncut. */
#define NANO_UNJUSTIFY_FKEY	NANO_UNCUT_FKEY	/* Same key as uncut. */
409
410
#define NANO_PREVLINE_KEY	NANO_CONTROL_P
#define NANO_NEXTLINE_KEY	NANO_CONTROL_N
Chris Allegretta's avatar
Chris Allegretta committed
411
412
413
#define NANO_FORWARD_KEY	NANO_CONTROL_F
#define NANO_BACK_KEY		NANO_CONTROL_B
#define NANO_MARK_KEY		NANO_CONTROL_6
414
#define NANO_ALT_MARK_KEY	NANO_ALT_A
Chris Allegretta's avatar
Chris Allegretta committed
415
416
417
418
419
420
421
#define NANO_HOME_KEY		NANO_CONTROL_A
#define NANO_END_KEY		NANO_CONTROL_E
#define NANO_DELETE_KEY		NANO_CONTROL_D
#define NANO_BACKSPACE_KEY	NANO_CONTROL_H
#define NANO_TAB_KEY		NANO_CONTROL_I
#define NANO_SUSPEND_KEY	NANO_CONTROL_Z
#define NANO_ENTER_KEY		NANO_CONTROL_M
422
#define NANO_FROMSEARCHTOGOTO_KEY NANO_CONTROL_T
Chris Allegretta's avatar
Chris Allegretta committed
423
#define NANO_TOFILES_KEY	NANO_CONTROL_T
424
#define NANO_APPEND_KEY		NANO_ALT_A
425
#define NANO_PREPEND_KEY	NANO_ALT_P
426
427
#define NANO_OPENPREV_KEY	NANO_ALT_LCARAT
#define NANO_OPENNEXT_KEY	NANO_ALT_RCARAT
428
429
#define NANO_OPENPREV_ALTKEY	NANO_ALT_COMMA
#define NANO_OPENNEXT_ALTKEY	NANO_ALT_PERIOD
430
#define NANO_BRACKET_KEY	NANO_ALT_RBRACKET
431
#define NANO_EXTCMD_KEY		NANO_CONTROL_X
432
433
#define NANO_NEXTWORD_KEY	NANO_CONTROL_SPACE
#define NANO_PREVWORD_KEY	NANO_ALT_SPACE
434
#define NANO_PARABEGIN_KEY	NANO_CONTROL_W
435
#define NANO_PARABEGIN_ALTKEY	NANO_ALT_P
436
#define NANO_PARAEND_KEY	NANO_CONTROL_O
437
#define NANO_PARAEND_ALTKEY	NANO_ALT_N
438
#define NANO_VERBATIM_KEY	NANO_ALT_V
Chris Allegretta's avatar
Chris Allegretta committed
439

Chris Allegretta's avatar
Chris Allegretta committed
440
441
#ifndef NANO_SMALL
/* Toggles do not exist with NANO_SMALL. */
442
443
444
445
446
447
#define TOGGLE_CONST_KEY	NANO_ALT_C
#define TOGGLE_AUTOINDENT_KEY	NANO_ALT_I
#define TOGGLE_SUSPEND_KEY	NANO_ALT_Z
#define TOGGLE_NOHELP_KEY	NANO_ALT_X
#define TOGGLE_MOUSE_KEY	NANO_ALT_M
#define TOGGLE_CUTTOEND_KEY	NANO_ALT_K
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
448
#define TOGGLE_REGEXP_KEY	NANO_ALT_R
449
#define TOGGLE_WRAP_KEY		NANO_ALT_L
450
#define TOGGLE_BACKWARDS_KEY	NANO_ALT_B
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
451
#define TOGGLE_CASE_KEY		NANO_ALT_C
452
#define TOGGLE_MULTIBUFFER_KEY	NANO_ALT_F
453
#define TOGGLE_DOS_KEY		NANO_ALT_D
454
#define TOGGLE_MAC_KEY		NANO_ALT_O
455
#define TOGGLE_SMOOTH_KEY	NANO_ALT_S
456
#define TOGGLE_NOCONVERT_KEY	NANO_ALT_N
457
#define TOGGLE_BACKUP_KEY	NANO_ALT_B
458
#define TOGGLE_SYNTAX_KEY	NANO_ALT_Y
Chris Allegretta's avatar
Chris Allegretta committed
459
#endif /* !NANO_SMALL */
460

461
#define MAIN_VISIBLE 12
Chris Allegretta's avatar
Chris Allegretta committed
462

Chris Allegretta's avatar
Chris Allegretta committed
463
464
465
#define VIEW 1
#define NOVIEW 0

Chris Allegretta's avatar
Chris Allegretta committed
466
typedef enum {
467
468
    TOP, CENTER, NONE
} topmidnone;
469

470
/* Minimum editor window rows required for nano to work correctly. */
471
472
#define MIN_EDITOR_ROWS 3

473
/* Minimum editor window cols required for nano to work correctly. */
474
475
#define MIN_EDITOR_COLS 10

Chris Allegretta's avatar
Chris Allegretta committed
476
/* Default number of characters from end-of-line where text wrapping
477
 * occurs. */
478
479
#define CHARS_FROM_EOL 8

Chris Allegretta's avatar
Chris Allegretta committed
480
/* Maximum number of search history strings saved, same value used for
481
 * replace history. */
482
#define MAX_SEARCH_HISTORY 100
Chris Allegretta's avatar
Chris Allegretta committed
483

Chris Allegretta's avatar
Chris Allegretta committed
484
#endif /* !NANO_H */