summaryrefslogtreecommitdiff
path: root/gramscii.c
diff options
context:
space:
mode:
authorKatolaZ <katolaz@freaknet.org>2019-07-20 18:30:48 +0100
committerKatolaZ <katolaz@freaknet.org>2019-07-20 18:30:48 +0100
commit130977d60200ae44ca6e27474a3127d1e8cd34b7 (patch)
tree9b1e371f67b1e79ea5b1e818bd8598aea62ab920 /gramscii.c
parent591777d6f9f064b5a3800ba656837b200c41b524 (diff)
add '.' command (reset line styles)
Diffstat (limited to 'gramscii.c')
-rw-r--r--gramscii.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/gramscii.c b/gramscii.c
index a832010..f5a3425 100644
--- a/gramscii.c
+++ b/gramscii.c
@@ -121,7 +121,7 @@ void status_bar(){
printf("\033[%d;1f\033[7m", HEIGHT+1);
printf("%100s", " ");
printf("\033[%d;1f\033[7m", HEIGHT+1);
- printf(" x:%3d y:%3d -- MODE:%4s HL:%c VL:%c CN:%c SM:%c EM:%c %10s",
+ printf(" x:%3d y:%3d -- MODE:%4s HL:%c VL:%c CN:%c SP:%c EP:%c %10s",
x, y, state_str(), line_h, line_v, corner, mark_st, mark_end, "");
if (!modified)
printf(" [%s]", fname );
@@ -220,12 +220,8 @@ void check_bound(){
else if (y>=HEIGHT) y = HEIGHT -1;
}
-void init_screen(){
- int i;
- for(i=0; i<HEIGHT; i++){
- memset(screen[i], ' ', WIDTH);
- screen[i][WIDTH]='\0';
- }
+void reset_styles(){
+
cur_corn = 0;
corner = corners[0];
cur_hl = cur_vl = 0;
@@ -234,6 +230,16 @@ void init_screen(){
line_v = vlines[cur_vl];
mark_st = st_marks[cur_start];
mark_end = end_marks[cur_end];
+
+}
+
+void init_screen(){
+ int i;
+ for(i=0; i<HEIGHT; i++){
+ memset(screen[i], ' ', WIDTH);
+ screen[i][WIDTH]='\0';
+ }
+ reset_styles();
}
void redraw(){
@@ -356,7 +362,6 @@ void toggle_end_mark(){
-
/***** text, box, arrows *****/
void get_text(){
@@ -699,7 +704,7 @@ void commands(){
state = TEXT;
get_text();
break;
- case 'r':
+ case 'R':
redraw();
break;
case 'b':
@@ -746,6 +751,9 @@ void commands(){
case '>':
toggle_end_mark();
break;
+ case '.':
+ reset_styles();
+ break;
case 'q':
check_modified();/** FALLTHROUGH **/
case 'Q':