Merge from vendor branch OPENSSH:
[dragonfly.git] / contrib / nvi / docs / TODO
1 CL:     In single-line screens, have to press 'q' twice when quitting out
2         of  a ":set all" display.
3
4 COMMON: There's a serious problem with error returns -- we need to separate
5         command failure from fatal error, consistently, over the entire source
6         tree.
7
8         We need to rework all of vi to have three return values:
9
10         0: success
11         1: vi error, continue
12         2: fatal error, die
13
14         Right now we don't recognize fatal errors for what they are.
15
16 VI:     Change the screen scrolling to not eat user characters...  i.e.
17         g/pattern/foo should not eat already entered chars.
18
19 COMMON: It's known that it's possible to sync the backing files in the
20         wrong manner, leaving backup files that aren't recoverable.  This
21         is going to be left alone until we have a logging version of DB,
22         which will hopefully fix this (or at least make it possible to
23         easily do so).
24
25 COMMON: The complete list of POSIX.1 calls that can return EINTR are:
26
27         wait, waitpid, sleep, dup2, close, read, write,
28         fcntl(SETLCKW) tcsetattr, tcdrain
29
30         The problem is that technically, any system/library call can
31         return EINTR, so, while nvi blocks (most of?) the obvious ones,
32         someone may have to do a complete pass and block signals
33         everywhere.
34
35 COMMON: The vi main command loop should use the general-purpose overflow
36         and underflow routines.  In addition, the vi command loop uses
37         unsigned longs -- should probably be fixed as a 32-bit unsigned
38         type, and then check to make sure it's never used as as variable
39         type again.
40
41 DB:     When nvi edits files that don't have trailing newlines, it appends
42         one, regardless.  This is required, by default, from POSIX.2.
43
44 COMMON: Open mode is not yet implemented.
45
46 COMMON: ^C isn't passed to the shell in the script windows as an interrupt
47         character.
48
49 COMMON: The options:
50
51         hardtabs, lisp, optimize, redraw, slowopen
52
53         are recognized, but not implemented.  These options are unlikely
54         to be implemented, so if you want them you might want to say
55         something!  I will implement lisp if anyone ever documents how it
56         worked.
57
58 COMMON: If you run out of space in the recovery directory, the recovery
59         file is left in place.
60
61 COMMON: Should "view" set a lock on the file?
62
63 COMMON: Field editing shouldn't be hard to add to nvi:
64
65         Field editing file template:
66
67         version #
68         field # row/column start        row/column stop
69         label   field #         Label string
70         re      field #         Matching re string.
71         field # row/column start        row/column stop
72         label   field #         Label string
73         re      field #         Matching re string.
74
75         <tab> moves to the next field
76         <bs> in column 0 moves to the previous field
77
78 COMMON: Let's rethink using an IPC mechanism:
79
80         Two way channel, with events passing in both directions.
81
82         Load into the same address space (else, how do file permissions) forks
83         in v_init -- screens get events from vi, vi gets events queued up from
84         screens.
85
86           Vi:
87                 E_CHARACTER,            /* Input character: e_c set. */
88                 E_EOF,                  /* End of input (NOT ^D). */
89                 E_ERR,                  /* Input error. */
90                 E_INTERRUPT,            /* Interrupt. */
91                 E_REPAINT,              /* Repaint: e_flno, e_tlno set. */
92                 E_RESIZE,               /* SIGWINCH: e_lno, e_cno set. */
93                 E_SIGCONT,              /* SIGCONT arrived. */
94                 E_SIGFATAL,             /* fatal signal arrived.
95                 E_START,                /* Start ex/vi. */
96                 E_STOP,                 /* Stop ex/vi. */
97                 E_STRING,               /* Input string: e_csp, e_len set. */
98
99           Screen:
100                 E_ADDSTR                /* Add a string to the screen. */
101                 E_ATTRIBUTE             /* Screen attribute. */
102                 E_BELL                  /* Beep/bell/flash the terminal. */
103                 E_BUSY                  /* Display a busy message. */
104                 E_CANONICAL             /* Enter tty canonical mode. */
105                 E_CLRTOEOL              /* Clear to the end of the line. */
106                 E_CURSOR                /* Return the cursor location. */
107                 E_DELETELN              /* Delete a line. */
108                 E_DISCARD               /* Discard a screen. */
109                 E_EXADJUST              /* Ex: screen adjustment routine. */
110                 E_FMAP                  /* Set a function key. */
111                 E_GETKEY                /* Get a key event. */
112                 E_INSERTLN              /* Insert a line. */
113                 E_MOVE                  /* Move the cursor. */
114                 E_MESSAGE               /* Message or ex output. */
115                 E_REFRESH               /* Refresh the screen. */
116                 E_RESIZE                /* Resize two screens. */
117                 E_SPLIT                 /* Split the screen. */
118                 E_SUSPEND               /* Suspend the editor. */
119
120 EX:     It would be nice to inverse video the replaced text during
121         interactive substitute.
122
123 EX:     The :args command should put the current file name out in reverse
124         video.  This isn't going to be easy, currently only full lines can
125         be in reverse video, not just parts.
126
127 TK:     We currently permit the user to change the lines, columns and term
128         edit options.  Shouldn't that be illegal in tknvi?
129
130 VI:     The strings found by searches should be highlighted until the next
131         character is entered.
132
133 VI:     Display a split vi screen for the :help command.
134
135 VI:     When getting a key for a continue screen, we should always read from
136         the terminal, not from a mapped key.
137
138 VI:     The sentence, paragraph and section movement commands don't match
139         historic practice in some boundary cases.  This should be left
140         alone until POSIX 1003.2 makes up its mind.
141
142 VI:     The vs_sm_fill routine should scroll if possible, not always redraw.
143
144 VI:     Think about setting a dirty/inuse bits on the lines of the SMAP
145         structure.  That way the message routines could steal lines and
146         refresh would continue to work, because it would know not to touch
147         the lines that were in use.