119304SpeterCL: In single-line screens, have to press 'q' twice when quitting out 219304Speter of a ":set all" display. 319304Speter 419304SpeterCOMMON: There's a serious problem with error returns -- we need to separate 519304Speter command failure from fatal error, consistently, over the entire source 619304Speter tree. 719304Speter 819304Speter We need to rework all of vi to have three return values: 919304Speter 1019304Speter 0: success 1119304Speter 1: vi error, continue 1219304Speter 2: fatal error, die 1319304Speter 1419304Speter Right now we don't recognize fatal errors for what they are. 1519304Speter 1619304SpeterVI: Change the screen scrolling to not eat user characters... i.e. 1719304Speter g/pattern/foo should not eat already entered chars. 1819304Speter 1919304SpeterCOMMON: It's known that it's possible to sync the backing files in the 2019304Speter wrong manner, leaving backup files that aren't recoverable. This 2119304Speter is going to be left alone until we have a logging version of DB, 2219304Speter which will hopefully fix this (or at least make it possible to 2319304Speter easily do so). 2419304Speter 2519304SpeterCOMMON: The complete list of POSIX.1 calls that can return EINTR are: 2619304Speter 2719304Speter wait, waitpid, sleep, dup2, close, read, write, 2819304Speter fcntl(SETLCKW) tcsetattr, tcdrain 2919304Speter 3019304Speter The problem is that technically, any system/library call can 3119304Speter return EINTR, so, while nvi blocks (most of?) the obvious ones, 3219304Speter someone may have to do a complete pass and block signals 3319304Speter everywhere. 3419304Speter 3519304SpeterCOMMON: The vi main command loop should use the general-purpose overflow 3619304Speter and underflow routines. In addition, the vi command loop uses 3719304Speter unsigned longs -- should probably be fixed as a 32-bit unsigned 3819304Speter type, and then check to make sure it's never used as as variable 3919304Speter type again. 4019304Speter 4119304SpeterDB: When nvi edits files that don't have trailing newlines, it appends 4219304Speter one, regardless. This is required, by default, from POSIX.2. 4319304Speter 4419304SpeterCOMMON: Open mode is not yet implemented. 4519304Speter 4619304SpeterCOMMON: ^C isn't passed to the shell in the script windows as an interrupt 4719304Speter character. 4819304Speter 4919304SpeterCOMMON: The options: 5019304Speter 5119304Speter hardtabs, lisp, optimize, redraw, slowopen 5219304Speter 5319304Speter are recognized, but not implemented. These options are unlikely 5419304Speter to be implemented, so if you want them you might want to say 5519304Speter something! I will implement lisp if anyone ever documents how it 5619304Speter worked. 5719304Speter 5819304SpeterCOMMON: If you run out of space in the recovery directory, the recovery 5919304Speter file is left in place. 6019304Speter 6119304SpeterCOMMON: Should "view" set a lock on the file? 6219304Speter 6319304SpeterCOMMON: Field editing shouldn't be hard to add to nvi: 6419304Speter 6519304Speter Field editing file template: 6619304Speter 6719304Speter version # 6819304Speter field # row/column start row/column stop 6919304Speter label field # Label string 7019304Speter re field # Matching re string. 7119304Speter field # row/column start row/column stop 7219304Speter label field # Label string 7319304Speter re field # Matching re string. 7419304Speter 7519304Speter <tab> moves to the next field 7619304Speter <bs> in column 0 moves to the previous field 7719304Speter 7819304SpeterCOMMON: Let's rethink using an IPC mechanism: 7919304Speter 8019304Speter Two way channel, with events passing in both directions. 8119304Speter 8219304Speter Load into the same address space (else, how do file permissions) forks 8319304Speter in v_init -- screens get events from vi, vi gets events queued up from 8419304Speter screens. 8519304Speter 8619304Speter Vi: 8719304Speter E_CHARACTER, /* Input character: e_c set. */ 8819304Speter E_EOF, /* End of input (NOT ^D). */ 8919304Speter E_ERR, /* Input error. */ 9019304Speter E_INTERRUPT, /* Interrupt. */ 9119304Speter E_REPAINT, /* Repaint: e_flno, e_tlno set. */ 9219304Speter E_RESIZE, /* SIGWINCH: e_lno, e_cno set. */ 9319304Speter E_SIGCONT, /* SIGCONT arrived. */ 9419304Speter E_SIGFATAL, /* fatal signal arrived. 9519304Speter E_START, /* Start ex/vi. */ 9619304Speter E_STOP, /* Stop ex/vi. */ 9719304Speter E_STRING, /* Input string: e_csp, e_len set. */ 9819304Speter 9919304Speter Screen: 10019304Speter E_ADDSTR /* Add a string to the screen. */ 10119304Speter E_ATTRIBUTE /* Screen attribute. */ 10219304Speter E_BELL /* Beep/bell/flash the terminal. */ 10319304Speter E_BUSY /* Display a busy message. */ 10419304Speter E_CANONICAL /* Enter tty canonical mode. */ 10519304Speter E_CLRTOEOL /* Clear to the end of the line. */ 10619304Speter E_CURSOR /* Return the cursor location. */ 10719304Speter E_DELETELN /* Delete a line. */ 10819304Speter E_DISCARD /* Discard a screen. */ 10919304Speter E_EXADJUST /* Ex: screen adjustment routine. */ 11019304Speter E_FMAP /* Set a function key. */ 11119304Speter E_GETKEY /* Get a key event. */ 11219304Speter E_INSERTLN /* Insert a line. */ 11319304Speter E_MOVE /* Move the cursor. */ 11419304Speter E_MESSAGE /* Message or ex output. */ 11519304Speter E_REFRESH /* Refresh the screen. */ 11619304Speter E_RESIZE /* Resize two screens. */ 11719304Speter E_SPLIT /* Split the screen. */ 11819304Speter E_SUSPEND /* Suspend the editor. */ 11919304Speter 12019304SpeterEX: It would be nice to inverse video the replaced text during 12119304Speter interactive substitute. 12219304Speter 12319304SpeterEX: The :args command should put the current file name out in reverse 12419304Speter video. This isn't going to be easy, currently only full lines can 12519304Speter be in reverse video, not just parts. 12619304Speter 12719304SpeterTK: We currently permit the user to change the lines, columns and term 12819304Speter edit options. Shouldn't that be illegal in tknvi? 12919304Speter 13019304SpeterVI: The strings found by searches should be highlighted until the next 13119304Speter character is entered. 13219304Speter 13319304SpeterVI: Display a split vi screen for the :help command. 13419304Speter 13519304SpeterVI: When getting a key for a continue screen, we should always read from 13619304Speter the terminal, not from a mapped key. 13719304Speter 13819304SpeterVI: The sentence, paragraph and section movement commands don't match 13919304Speter historic practice in some boundary cases. This should be left 14019304Speter alone until POSIX 1003.2 makes up its mind. 14119304Speter 14219304SpeterVI: The vs_sm_fill routine should scroll if possible, not always redraw. 14319304Speter 14419304SpeterVI: Think about setting a dirty/inuse bits on the lines of the SMAP 14519304Speter structure. That way the message routines could steal lines and 14619304Speter refresh would continue to work, because it would know not to touch 14719304Speter the lines that were in use. 148