cc8beb8578
=============================================== 1. Deletion of last line in file using 'dd' caused infinite loop searching for 'nextline'. Fixed. 2. Insertion of line above 1st line using 'O' caused line to be inserted on 2nd line. Fixed. 3. Paste buffer from 'dd' was being free'd after the 'p'aste operation, preventing multiple paste opportunity. Fixed. 4. The cursor was not being bound to the line end and was allowed to 'hover' over the '\n' EOL character. This caused wierd (relative to standard vi) insertion locations and cursor movement with 'a'ppend and 'i'nsert. Fixed. 5. The 'vi_shrinkpos' position didn't take the end of file pointer into account when calculating 'curpos', 'prevpos' variables causing wierdness when deleting things near the end of the file. Fixed. 6. The 'yy'ank command was improperly deleting the text from the document instead of simply yanking to the paste buffer. Fixed. 7. The 'dd'elete line funciton was not copying the deleted line to the paste buffer as part of the delete operation. Fixed. 8. The bottom line of the screen was sometimes being used for document text and other times for command / find entry. Fixed by reserving the bottom the bottom line for status / command only. 9. When scrolling up / down through a file, the cursor position was not preserved and moved further and further to the left column based on the line lengths of the lines visited. Fixed. 10. The display was being COMPLETELY redrawn with each keystroke, causing the responsiveness to be imbearable. Fixed. Added logic to dynamicall indicated which portions of the screen need to be updated (full display, current line to end of screen, current line only, none). 11. The individual display line updates were being performed a character at a time by calling the vi_putch() function, causing slow performance, especially in telnet or USBCDC sessions where there is a lot of overhead per packet. Fixed by calling vi_write() instead with a block of characters with breaks as needed for TAB exansion. 12. The forward delete 'x' operation allowed deletion through '\n' characters causing lines to be joined. This is different from standard vi where 'x' at the end of a line performs a delete backward operation. Fixed. 13. When in 'ex' or find sub-modes (':' or '/' bottom line modes), hitting backspace with empty text did not return the operation to command mode like it does in standard vi. Fixed. 14. Performing a 'find' opertation would only search from the current cursor position to the end of the file and did not wrap like in standard vi. Fixed. 15. Loading a file that was larger than the initial text allocation would force a call to 'vi_extendtext', marking the file as modified when in fact it hadn't even been loaded yet. Fixed. 16. Combined vi_insert_mode and vi_replace_mode into a single function to save code space since they are nearly identical routines. 17. In command mode, backspace was deleting characters which is different from standard vi. Backspace in command mode normally simply moves the cursor left / to the previous line. Fixed. 18. Added code to handle boundry conditions when the file is new and commands are applied to an empty file. 19. Fixed vi_shrinktext so it doesn't allocate a zero-length buffer when the last character in the file is deleted. 20. The 'x' command was not copying to the paste buffer. Fixed. 21. Fixed parsecolon routine to properly deal with ":wq" command sequence. New feature additions ===================== 1. Vi startup feature to prepend the current working directory to the supplied filename if it does not start with '/' absolute path specifier. This allows editing files in the current directory without needing to fully qualify the filename. 2. Standard '~' empty screen line characters for proper identification of empty '\n' only lines at the end of the file. 3. Moving into insert or append mode now prints '--INSERT--' in the status line and clears it upon exit. 4. Integration with termcurses to detect special keystrokes and to handle terminal type differences. Haven't yet converted all vt100 print codes to termcurses equivalents. 5. Support for up, down, left, right arrows, page-up, page-down keys in command mode. 6. Added 'b' command to move cursor 'b'ack to previous word. Honors the command repeat value for multiple word moves. 7. Added 'w' command to move cursor to next 'w'ord. Honors the command repeat value for multiple word moves. 8. Added 'f' and 't' commands to find characters on the current line. Honors the command repeat value. 9. Added the find 'n'ext command to repeat the previous find operation. 10. Added the 'H', 'M', and 'L' commands to move the cursor to top, middle and bottom of the display. 11. Extended yank/paste to manage a paste buffer with character mode in addition to line mode. Character mode allows cut / paste of individual characters or groups of characters vs. full lines. 12. Added support in the 'd'elete and 'y'ank commands for character mode deletions such as 'dw', 'dfa', '2yw', etc. 13. Added support in paste routine for multiple paste using command value argument. 14. Added support for the 'D' and 'C' delete and change to end of line commands. 15. Added support for 's'ubstitute key ('x' followed by insert mode). 16. Modified yank / paste allocation scheme to avoid repeated alloc and free of paste buffer. Uses a minimum allocation size scheme and only does free / realloc when paste does not fit. If the paste is smaller than the current allocation and the current allocation is larger than the threshold, then the buffer is freed and a smaller buffer allocated. Otherwise the existing buffer is used. 17. Support for 'P'aste before current cursor position. 18. Support for '?' reverse search mode. 19. Support for 'J'oin next line with current line command. 20. Printing of current row,col in status line of display. 21. Command repeat '.' support for commands that modifiy text. 22. Support in replace / insert mode for arrow keys, PGUP / PGDN, HOME, and END. Using these will cause the command repeat buffer to reset such that only the last text addition after a cursor movement is saved. 23. Added 'X' delete previous command. 24. Added "gg" go to top of document command sequence. 25. Added "ZZ" save and quit command (equivalent to :wq). 26. Implemented '^' goto first non-whitespace on current line, along with '+' and '-' goto first non-whitespace on next / previous line. 27. Added CR / LF goto first non-whitespace on next line in command mode.
108 lines
3.3 KiB
Plaintext
108 lines
3.3 KiB
Plaintext
#
|
|
# For a description of the syntax of this configuration file,
|
|
# see the file kconfig-language.txt in the NuttX tools repository.
|
|
#
|
|
|
|
menuconfig SYSTEM_VI
|
|
tristate "VI Work-Alike Text Editor"
|
|
select SYSTEM_TERMCURSES
|
|
default n
|
|
---help---
|
|
Enable support for NuttX tiny VI work-alike editor.
|
|
|
|
Omitted features:
|
|
- No keypad cursor control support
|
|
- No word oriented operations.
|
|
|
|
Assumptions and Limitations:
|
|
- A VT100 host terminal is assumed. At 115200 BAUD, screen
|
|
update times with a 24x64 edit region are noticeable but
|
|
acceptable.
|
|
- A fixed width character set (like Courier) is assumed
|
|
- Files are edited in memory so unless you have a lot of memory
|
|
to spare, this editor will only be useful for very small files.
|
|
|
|
Size: As of 2013-01-30, it appears that the size will vary from
|
|
about 8.5 to 10.5KB, depending upon the efficiency of the
|
|
underlying architecture.
|
|
|
|
if SYSTEM_VI
|
|
|
|
config SYSTEM_VI_COLS
|
|
int "Display width (columns)"
|
|
default 64
|
|
---help---
|
|
The editor does not have the capability to query the display for
|
|
its width or height. This setting provides the default width of
|
|
the display in columns. The actually width can be overridden using
|
|
command line options.
|
|
|
|
The default column width for a VT100 terminal is 80 characters. The
|
|
default for this setting is smaller, 64, so that a smaller in-memory
|
|
buffer is used. You might have a better experience wth a column
|
|
width of 80 (if the terminal width is not controllable from your
|
|
terminal application).
|
|
|
|
config SYSTEM_VI_ROWS
|
|
int "Display height (rows)"
|
|
default 16
|
|
---help---
|
|
The editor does not have the capability to query the display for
|
|
its width or height. This setting provides the default height of
|
|
the display in rows. The actually width can be overridden using
|
|
command line options.
|
|
|
|
The default height for a VT100 terminal is 64 rows. The default
|
|
for this setting is smaller, 16, so that a smaller in-memory
|
|
buffer is used. You might have a better experience wth a height
|
|
of 64 rows (if the terminal height is not controllable from your
|
|
terminal application).
|
|
|
|
config SYSTEM_VI_DEBUGLEVEL
|
|
int "Debug level"
|
|
default 0
|
|
range 0 2
|
|
---help---
|
|
0=Debug off; 1=Print errors on console; 2=Print debug information
|
|
on the console.
|
|
|
|
Debug output is generated with syslog. The editor works on
|
|
/dev/console. In order to get both a usable display and also
|
|
readable debug output, syslog'ing should sent to some device other
|
|
than /dev/console (which is the default).
|
|
|
|
if NSH_BUILTIN_APPS
|
|
|
|
config SYSTEM_VI_STACKSIZE
|
|
int "Builtin task stack size"
|
|
default 2048
|
|
---help---
|
|
Size of the task to configure when started VI from NSH
|
|
|
|
config SYSTEM_VI_PRIORITY
|
|
int "Builtin task priority"
|
|
default 100
|
|
---help---
|
|
Priority of the task to configure when started VI from NSH
|
|
|
|
config SYSTEM_VI_INCLUDE_COMMAND_REPEAT
|
|
bool "Include support for '.' command repeat key"
|
|
default y
|
|
|
|
# These are placeholders and will be implemented soon
|
|
#config SYSTEM_VI_INCLUDE_UNDO
|
|
# bool "Include undo/redo support"
|
|
# default y
|
|
# ---help---
|
|
# Adds multi-level undo / redo support.
|
|
#
|
|
#config SYSTEM_VI_UNDO_LEVELS
|
|
# int "Undo / Redo stack size"
|
|
# depends on SYSTEM_VI_INCLUDE_UNDO
|
|
# default 10
|
|
# ---help---
|
|
# Number of undo / redo operations saved.
|
|
|
|
endif # NSH_BUILTIN_APPS
|
|
endif # SYSTEM_VI
|