summaryrefslogtreecommitdiff
path: root/usr.bin/vi/docs/TODO
blob: 98def63521368a19e586f5650ba81c55bc64582e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
CL:	I believe the :resize command isn't always repainting the status line,
	but I can't reproduce it.

CL:	In single-line screens, have to press 'q' twice when quitting out
	of  a ":set all" display.

COMMON:	There's a serious problem with error returns -- we need to separate
	command failure from fatal error, consistently, over the entire source
	tree.

	We need to rework all of vi to have three return values:

	0: success
	1: vi error, continue
	2: fatal error, die

	Right now we don't recognize fatal errors for what they are.

VI:	Change the screen scrolling to not eat user characters...  i.e.
	g/pattern/foo should not eat already entered chars.

COMMON:	It's known that it's possible to sync the backing files in the
	wrong manner, leaving backup files that aren't recoverable.  This
	is going to be left alone until we have a logging version of DB,
	which will hopefully fix this (or at least make it possible to
	easily do so).

COMMON:	The complete list of POSIX.1 calls that can return EINTR are:

	wait, waitpid, sleep, dup2, close, read, write,
	fcntl(SETLCKW) tcsetattr, tcdrain

	The problem is that technically, any system/library call can
	return EINTR, so, while nvi blocks (most of?) the obvious ones,
	someone may have to do a complete pass and block signals
	everywhere.

COMMON: The vi main command loop should use the general-purpose overflow
	and underflow routines.  In addition, the vi command loop uses
	unsigned longs -- should probably be fixed as a 32-bit unsigned
	type, and then check to make sure it's never used as as variable
	type again.

DB:	When nvi edits files that don't have trailing newlines, it appends
	one, regardless.  This is required, by default, from POSIX.2.

COMMON:	Open mode is not yet implemented.

COMMON:	^C isn't passed to the shell in the script windows as an interrupt
	character.

COMMON:	The options:

	hardtabs, lisp, optimize, redraw, slowopen

	are recognized, but not implemented.  These options are unlikely
	to be implemented, so if you want them you might want to say
	something!  I will implement lisp if anyone ever documents how it
	worked.

COMMON:	If you run out of space in the recovery directory, the recovery
	file is left in place.

COMMON:	Should "view" set a lock on the file?

COMMON:	Field editing shouldn't be hard to add to nvi:

	Field editing file template:

	version #
	field #	row/column start	row/column stop
	label	field #		Label string
	re	field #		Matching re string.
	field #	row/column start	row/column stop
	label	field #		Label string
	re	field #		Matching re string.

	<tab> moves to the next field
	<bs> in column 0 moves to the previous field

COMMON:	Let's rethink using an IPC mechanism:

	Two way channel, with events passing in both directions.

	Load into the same address space (else, how do file permissions) forks
	in v_init -- screens get events from vi, vi gets events queued up from
	screens.

	  Vi:
		E_CHARACTER,            /* Input character: e_c set. */
		E_EOF,                  /* End of input (NOT ^D). */
		E_ERR,                  /* Input error. */
		E_INTERRUPT,            /* Interrupt. */
		E_REPAINT,              /* Repaint: e_flno, e_tlno set. */
		E_RESIZE,               /* SIGWINCH: e_lno, e_cno set. */
		E_SIGCONT,              /* SIGCONT arrived. */
		E_SIGFATAL,             /* fatal signal arrived.
		E_START,                /* Start ex/vi. */
		E_STOP,                 /* Stop ex/vi. */
		E_STRING,               /* Input string: e_csp, e_len set. */

	  Screen:
		E_ADDSTR		/* Add a string to the screen. */
		E_ATTRIBUTE		/* Screen attribute. */
		E_BELL			/* Beep/bell/flash the terminal. */
		E_BUSY			/* Display a busy message. */
		E_CANONICAL		/* Enter tty canonical mode. */
		E_CLRTOEOL		/* Clear to the end of the line. */
		E_CURSOR		/* Return the cursor location. */
		E_DELETELN		/* Delete a line. */
		E_DISCARD		/* Discard a screen. */
		E_EXADJUST		/* Ex: screen adjustment routine. */
		E_FMAP			/* Set a function key. */
		E_GETKEY		/* Get a key event. */
		E_INSERTLN		/* Insert a line. */
		E_MOVE			/* Move the cursor. */
		E_MESSAGE		/* Message or ex output. */
		E_REFRESH		/* Refresh the screen. */
		E_RESIZE		/* Resize two screens. */
		E_SPLIT			/* Split the screen. */
		E_SUSPEND		/* Suspend the editor. */

EX:	It would be nice to inverse video the replaced text during
	interactive substitute.

EX:	The :args command should put the current file name out in reverse
	video.  This isn't going to be easy, currently only full lines can
	be in reverse video, not just parts.

TK:	We currently permit the user to change the lines, columns and term
	edit options.  Shouldn't that be illegal in tknvi?

VI:	The strings found by searches should be highlighted until the next
	character is entered.

VI:	Display a split vi screen for the :help command.

VI:	When getting a key for a continue screen, we should always read from
	the terminal, not from a mapped key.

VI:	The sentence, paragraph and section movement commands don't match
	historic practice in some boundary cases.  This should be left
	alone until POSIX 1003.2 makes up its mind.

VI:	The vs_sm_fill routine should scroll if possible, not always redraw.

VI:	Think about setting a dirty/inuse bits on the lines of the SMAP
	structure.  That way the message routines could steal lines and
	refresh would continue to work, because it would know not to touch
	the lines that were in use.