dzp 1 рік тому
батько
коміт
12a6572158
3 змінених файлів з 14 додано та 9 видалено
  1. 4 0
      TODO
  2. 4 9
      src/draw.c
  3. 6 0
      src/validate

+ 4 - 0
TODO

@@ -1,3 +1,5 @@
+- #draw tile 1 1 1 1 {\x7B}
+
 - Add an example script to display time left on tickers using #info tickers save
 
 - comprehensive memory breakdown for variables/triggers/mapper/etc
@@ -13,6 +15,8 @@
 
 - Add an option to insert multiple items to a list
 
+- allow setting output encoding for #port
+
 - https://github.com/mintty/mintty/wiki/CtrlSeqs#audio-support
 - mintty --configdir DIRNAME
 

+ 4 - 9
src/draw.c

@@ -639,7 +639,7 @@ void scale_drawing(struct session *ses, int *top_row, int *top_col, int *bot_row
 
 	while (*arg)
 	{
-		arg = sub_arg_in_braces(ses, arg, buf, GET_ALL, SUB_VAR|SUB_FUN|SUB_COL|SUB_LIT|SUB_ESC);
+		arg = sub_arg_in_braces(ses, arg, buf, GET_ALL, SUB_COL|SUB_LIT|SUB_ESC);
 
 		word_wrap_split(ses, buf, out, max_width - bor_width, 0, 0, WRAP_FLAG_NONE, &height, &width);
 
@@ -1568,7 +1568,7 @@ DO_DRAW(draw_line_horizontal)
 
 	corner = flags;
 
-	sub_arg_in_braces(ses, arg, arg2, GET_ALL, SUB_COL|SUB_LIT|SUB_ESC|SUB_VAR|SUB_FUN);
+	sub_arg_in_braces(ses, arg, arg2, GET_ALL, SUB_COL|SUB_LIT|SUB_ESC);
 
 	arg = arg2;
 
@@ -2347,7 +2347,7 @@ DO_DRAW(draw_table_grid)
 					{
 						strcpy(buf2, row_color);
 
-						str = sub_arg_in_braces(ses, str, buf2 + strlen(buf2), GET_ALL, SUB_VAR|SUB_FUN|SUB_LIT|SUB_ESC|SUB_COL);
+						str = sub_arg_in_braces(ses, str, buf2 + strlen(buf2), GET_ALL, SUB_LIT|SUB_ESC|SUB_COL);
 
 //						get_color_codes(row_color, buf2, row_color, GET_ALL);
 
@@ -2468,11 +2468,6 @@ DO_DRAW(draw_text)
 
 	txt = buf2;
 
-	substitute(ses, arg, buf1, SUB_VAR|SUB_FUN);
-	substitute(ses, buf1, buf3, SUB_ESC|SUB_COL|SUB_LIT);
-
-	arg = buf3;
-
 	if (*arg3)
 	{
 		txt += substitute(ses, arg3, txt, SUB_COL|SUB_LIT|SUB_ESC);
@@ -2486,7 +2481,7 @@ DO_DRAW(draw_text)
 	{
 		while (*arg)
 		{
-			arg = get_arg_in_braces(ses, arg, buf1, GET_ALL);
+			arg = sub_arg_in_braces(ses, arg, buf1, GET_ALL, SUB_COL|SUB_LIT|SUB_ESC);
 
 			txt += sprintf(txt, "%s\n", buf1);
 

+ 6 - 0
src/validate

@@ -57,6 +57,12 @@
 	#draw Lime Azure ualign  box 28 61 31 79 { u\na\nl\ni\ng\nn};
 	#draw Lime Azure scaled  box 28 81 31 99 scaled;
 
+	#draw Violet Jade box 32  1 37 19 test of a test of a test;
+	#draw Violet Jade box 32 21 37 39 {test} {of a test} {of a test};
+	#draw Violet Jade box 32 41 37 59 test\nof a test\nof a test;
+	#draw Violet Jade box 32 61 37 79 color<118>test<128>test<138>test<148>test;
+	#draw Violet Jade box 32 81 37 99 {  offset test};
+
 
 
 	#end \