Re: mc editor small changes III - unified diff



Hello Frantisek,

On Thu, 2005-08-11 at 09:07 +0200, František Řezníček wrote:
> here are the changes (just unified diff) :
Please send the patch as an attachment for the next time, it makes
extraction of it less painful.

> # Should I use the latest nighbuild and incorporate the changes there or you can
> # do it?
The best is probably to send here a ported patch to one of the latest
releases as it's likely that the patch will be applied smoothly to HEAD.

> # Could I hope to have these minor changes in the official mc?
I modified the patch a bit so that it looks bit better now. Please avoid
shipping commented-out code within the patch.

The question is whether highlighting of '<' and '>' is desirable in all
cases. Highlighting of such characters doesn't make too much sense when
editing C source files for instance.

mc-devel, what's your opition on this? Yes/No?

Attaching the updated patch -> applies smoothly to 4.6.1.

Best,
Jindrich

-- 
Jindrich Novy <jnovy redhat com>, http://people.redhat.com/jnovy/
(o_                                                           _o)
//\      The worst evil in the world is refusal to think.     //\
V_/_                                                         _\_V

--- mc-4.6.1/src/color.h.bracket	2004-09-02 00:33:43.000000000 +0200
+++ mc-4.6.1/src/color.h	2005-08-13 11:02:16.000000000 +0200
@@ -83,6 +83,8 @@
 #define ERROR_HOT_NORMAL   IF_COLOR (37, 0)
 #define ERROR_HOT_FOCUS    IF_COLOR (38, 0)
 
+#define EDITOR_MARKEDBRACKET_COLOR   IF_COLOR (39, A_REVERSE)
+
 #ifdef HAVE_SLANG
 #   define CTYPE const char *
 #else
--- mc-4.6.1/src/color.c.bracket	2005-05-27 16:19:18.000000000 +0200
+++ mc-4.6.1/src/color.c	2005-08-13 11:02:16.000000000 +0200
@@ -100,6 +100,7 @@
 /* error dialog colors start at 37 */
     { "errdhotnormal=",  0, 0 }, /* Error dialog normal/hot */ /* 37 */
     { "errdhotfocus=",   0, 0 }, /* Error dialog focused/hot */
+    { "markedbracket=",     0, 0 },	/* marked/selected bracket */
 };
 
 struct color_table_s {
@@ -162,7 +163,8 @@
 "editbold=yellow,blue:"
 "editmarked=black,cyan:"
 "errdhotnormal=yellow,red:"
-"errdhotfocus=yellow,lightgray";
+"errdhotfocus=yellow,lightgray:"
+"markedbracket=yellow,brightmagenta";
 
 #ifdef HAVE_SLANG
 #   define color_value(i) color_table [i].name
--- mc-4.6.1/edit/edit.c.bracket	2005-08-13 11:02:15.000000000 +0200
+++ mc-4.6.1/edit/edit.c	2005-08-13 11:02:16.000000000 +0200
@@ -2147,7 +2147,7 @@
 /* this find the matching bracket in either direction, and sets edit->bracket */
 static long edit_get_bracket (WEdit * edit, int in_screen, unsigned long furthest_bracket_search)
 {
-    const char * const b = "{}{[][()(", *p;
+    const char * const b = "{}{[][()(<><", *p;
     int i = 1, a, inc = -1, c, d, n = 0;
     unsigned long j = 0;
     long q;
@@ -2163,7 +2163,7 @@
 /* the matching bracket */
     d = p[1];
 /* going left or right? */
-    if (strchr ("{[(", c))
+    if (strchr ("{[(<", c))
 	inc = 1;
     for (q = edit->curs1 + inc;; q += inc) {
 /* out of buffer? */
--- mc-4.6.1/edit/editdraw.c.bracket	2005-08-13 11:02:15.000000000 +0200
+++ mc-4.6.1/edit/editdraw.c	2005-08-13 11:07:19.000000000 +0200
@@ -38,6 +38,7 @@
 #define MOD_BOLD		(1 << 9)
 #define MOD_MARKED		(1 << 10)
 #define MOD_CURSOR		(1 << 11)
+#define MOD_MARKEDBRACKET       (1 << 12)
 
 #define FONT_OFFSET_X 0
 #define FONT_OFFSET_Y 0
@@ -235,6 +236,8 @@
 	    set_color (EDITOR_BOLD_COLOR);
 	} else if (style & MOD_MARKED) {
 	    set_color (EDITOR_MARKED_COLOR);
+	} else if (style & MOD_MARKEDBRACKET) {
+	    set_color (EDITOR_MARKEDBRACKET_COLOR);
 	} else {
 	    lowlevel_set_color (color);
 	}
@@ -292,7 +295,7 @@
 			p->style |= MOD_MARKED;
 		}
 		if (q == edit->bracket)
-		    p->style |= MOD_BOLD;
+		    p->style |= MOD_MARKEDBRACKET;
 		if (q >= edit->found_start
 		    && q < edit->found_start + edit->found_len)
 		    p->style |= MOD_BOLD;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]