FujiNetWIFI / fujinet-config

#FujiNet cross-platform CONFIG program
GNU General Public License v3.0
6 stars 19 forks source link

Add enhanced line editing #74

Closed markjfisher closed 1 year ago

markjfisher commented 1 year ago

This adds a new function "_edit_line" with enhanced cursor control for line editing in config.

I took the routine from new-config, and adjusted it to fit this config.

keys supported:

ctrl-a : beginning of line ctrl-e : end of line ctrl-k : kill to end of line delete : deletes previous char ctrl-del : deletes char under cursor ESC : cancel editing ctrl left/right : move cursor left/right

Escape now restores the previous string that was there. Unfortunately, non of the signatures of functions that do editing ever react to the return value, and are all void, so ESC as cancel doesn't stop the config from being saved, or entering wifi passwords from stopping the process, but this is a limitation of the current functions, not the editing.