diff options
author | KatolaZ <katolaz@freaknet.org> | 2019-08-16 19:36:20 +0100 |
---|---|---|
committer | KatolaZ <katolaz@freaknet.org> | 2019-08-16 19:36:20 +0100 |
commit | 02c54fe6f289901f5b356ca98a81dec78fef4f36 (patch) | |
tree | 506c43e08f4dc34ce92cb41af6539f6e73cdf68e | |
parent | 0940cd06c4a36b4794c48ebc703559caf7d53c53 (diff) |
add support for comments
-rw-r--r-- | Changelog | 9 | ||||
-rw-r--r-- | TODO | 2 | ||||
-rw-r--r-- | draw.c | 9 | ||||
-rw-r--r-- | gramscii.1 | 4 | ||||
-rw-r--r-- | gramscii.c | 4 | ||||
-rw-r--r-- | gramscii.h | 2 | ||||
-rw-r--r-- | screen.c | 2 |
7 files changed, 31 insertions, 1 deletions
@@ -1,3 +1,12 @@ +0940cd0 2019-08-14 (KatolaZ) update manpage to include parallelogram +a95019d 2019-08-14 (KatolaZ) add parallelogram mode +257ec5d 2019-08-13 (KatolaZ) towards parallelograms +39ec615 2019-08-12 (Quentin Rameau) Arrange makefile debug target +3d5be35 2019-08-12 (KatolaZ) accept commands from stdin in script-mode +0522ef6 2019-08-12 (KatolaZ) fix read of command scripts and script-mode +a46183e 2019-08-11 (KatolaZ) replace cleanup() with exit() in usage() +e4c527b 2019-08-09 (KatolaZ) check all mem allocations +a6f10d6 2019-08-09 (KatolaZ) release 0.3 1ad3249 2019-08-09 (KatolaZ) bump version to 0.3 bc374cf 2019-08-09 (KatolaZ) update TODO 0c0e806 2019-08-09 (KatolaZ) small change to manpage @@ -1,5 +1,4 @@ + optimize redraws (redraw only the modified rectangle) -- implement comment (#: ignore everything until the end of the line) - add screen geometry option (-g 25x80?) - (?)maybe move "text" mode to "t" - implement ellipse @@ -14,6 +13,7 @@ - allow scrolling (both vertical and horizontal) - catch SIGWINCH and react appropriately (after scrolling is enabled) +* implement comment (#: ignore everything until the end of the line) * implement parallelogram mode (z/Z) * fix bug in reading commands from files * fix bug in visual crop @@ -508,3 +508,12 @@ void redo_change(){ redraw(); } + +/** Comments **/ + +void get_comment(FILE *fc){ + char c; + redraw(); + while((c = fgetc(fc)) != EOF && c != '\n'); + mode = MOVE; +} @@ -144,6 +144,10 @@ prompted for a filename to save the screen to. Write the current screen to a new file. This commands acts like .B w but always prompts for a file name to use. +.TP 5m +.BI # +Start a comment. Discard all the characters until a newline is +entered. Useful to include comments in scripts. .SS MOVEMENTS The following movement commands are available in any mode where cursor @@ -138,6 +138,10 @@ void commands(FILE *fc){ mode = PAR; get_box(fc, BOX_PARR); break; + case '#': + mode = REM; + get_comment(fc); + break; case 'q': check_modified(fc);/** FALLTHROUGH **/ case 'Q': @@ -19,6 +19,7 @@ #define DEL 0x08 #define VIS 0x10 #define PAR 0x20 +#define REM 0x40 /**/ /* directions */ @@ -186,6 +187,7 @@ void visual_box(FILE *fc); void paste(); void undo_change(); void redo_change(); +void get_comment(FILE *fc); /**/ /** file-related functions **/ @@ -37,6 +37,8 @@ char* mode_str(){ return "vis"; case PAR: return "par"; + case REM: + return "rem"; default: return "ERR"; } |