qemacs-commit
[Top][All Lists]
Advanced

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

[Qemacs-commit] qemacs clang.c extras.c latex-mode.c markdown.c...


From: Charlie Gordon
Subject: [Qemacs-commit] qemacs clang.c extras.c latex-mode.c markdown.c...
Date: Tue, 18 Mar 2014 08:20:07 +0000

CVSROOT:        /sources/qemacs
Module name:    qemacs
Changes by:     Charlie Gordon <chqrlie>        14/03/18 08:20:06

Modified files:
        .              : clang.c extras.c latex-mode.c markdown.c 
                         orgmode.c qe.h qe.c 

Log message:
        improve colorizer for long lines
        
        * use COLORED_MAX_LINE_SIZE for line buffers
        * incomplete fix for "ERROR: cursor not found" bugs

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemacs/clang.c?cvsroot=qemacs&r1=1.49&r2=1.50
http://cvs.savannah.gnu.org/viewcvs/qemacs/extras.c?cvsroot=qemacs&r1=1.23&r2=1.24
http://cvs.savannah.gnu.org/viewcvs/qemacs/latex-mode.c?cvsroot=qemacs&r1=1.42&r2=1.43
http://cvs.savannah.gnu.org/viewcvs/qemacs/markdown.c?cvsroot=qemacs&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/qemacs/orgmode.c?cvsroot=qemacs&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/qemacs/qe.h?cvsroot=qemacs&r1=1.152&r2=1.153
http://cvs.savannah.gnu.org/viewcvs/qemacs/qe.c?cvsroot=qemacs&r1=1.158&r2=1.159

Patches:
Index: clang.c
===================================================================
RCS file: /sources/qemacs/qemacs/clang.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -b -r1.49 -r1.50
--- clang.c     15 Mar 2014 23:00:07 -0000      1.49
+++ clang.c     18 Mar 2014 08:20:04 -0000      1.50
@@ -285,7 +285,6 @@
     *colorize_state_ptr = state;
 }
 
-#define MAX_BUF_SIZE    512
 #define MAX_STACK_SIZE  64
 
 /* gives the position of the first non white space character in
@@ -394,7 +393,7 @@
 {
     int offset, offset1, offsetl, c, pos, line_num, col_num;
     int i, j, eoi_found, len, pos1, lpos, style, line_num1, state;
-    unsigned int buf[MAX_BUF_SIZE], *p;
+    unsigned int buf[COLORED_MAX_LINE_SIZE], *p;
     unsigned char stack[MAX_STACK_SIZE];
     char buf1[64], *q;
     int stack_ptr;

Index: extras.c
===================================================================
RCS file: /sources/qemacs/qemacs/extras.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- extras.c    12 Mar 2014 05:50:23 -0000      1.23
+++ extras.c    18 Mar 2014 08:20:04 -0000      1.24
@@ -175,12 +175,11 @@
 }
 
 /* forward / backward block */
-#define MAX_BUF_SIZE  512
 #define MAX_LEVEL     20
 
 static void do_forward_block(EditState *s, int dir)
 {
-    unsigned int buf[MAX_BUF_SIZE];
+    unsigned int buf[COLORED_MAX_LINE_SIZE];
     char balance[MAX_LEVEL];
     int line_num, col_num, offset, offset1, len, pos, style, c, c1, level;
 

Index: latex-mode.c
===================================================================
RCS file: /sources/qemacs/qemacs/latex-mode.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -b -r1.42 -r1.43
--- latex-mode.c        6 Feb 2014 00:22:17 -0000       1.42
+++ latex-mode.c        18 Mar 2014 08:20:05 -0000      1.43
@@ -22,8 +22,6 @@
 
 #include "qe.h"
 
-#define MAX_BUF_SIZE    512
-
 /* TODO: add state handling to allow colorization of elements longer
  * than one line (eg, multi-line functions and strings)
  */
@@ -146,7 +144,7 @@
 static void do_tex_insert_quote(EditState *s)
 {
     int offset_bol, len, offset1;
-    unsigned int buf[MAX_BUF_SIZE];
+    unsigned int buf[COLORED_MAX_LINE_SIZE];
     int pos;
 
     offset_bol = eb_goto_bol2(s->b, s->offset, &pos);

Index: markdown.c
===================================================================
RCS file: /sources/qemacs/qemacs/markdown.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- markdown.c  15 Mar 2014 13:47:26 -0000      1.6
+++ markdown.c  18 Mar 2014 08:20:05 -0000      1.7
@@ -67,7 +67,6 @@
 #define IN_LEVEL       0x0700
 #define LEVEL_SHIFT  8
 
-#define MAX_BUF_SIZE    512
 #define MAX_LEVEL       128
 
 /* TODO: define specific styles */

Index: orgmode.c
===================================================================
RCS file: /sources/qemacs/qemacs/orgmode.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- orgmode.c   10 Mar 2014 22:11:24 -0000      1.14
+++ orgmode.c   18 Mar 2014 08:20:05 -0000      1.15
@@ -28,7 +28,6 @@
 #define IN_LISP        0x40
 #define IN_TABLE       0x20
 
-#define MAX_BUF_SIZE    512
 #define MAX_LEVEL       128
 
 /* TODO: define specific styles */

Index: qe.h
===================================================================
RCS file: /sources/qemacs/qemacs/qe.h,v
retrieving revision 1.152
retrieving revision 1.153
diff -u -b -r1.152 -r1.153
--- qe.h        15 Mar 2014 23:15:54 -0000      1.152
+++ qe.h        18 Mar 2014 08:20:05 -0000      1.153
@@ -1033,6 +1033,8 @@
 
 /* qe.c */
 
+#define COLORED_MAX_LINE_SIZE  4096
+
 /* colorize & transform a line, lower level then ColorizeFunc */
 typedef int (*GetColorizedLineFunc)(EditState *s,
                                     unsigned int *buf, int buf_size,

Index: qe.c
===================================================================
RCS file: /sources/qemacs/qemacs/qe.c,v
retrieving revision 1.158
retrieving revision 1.159
diff -u -b -r1.158 -r1.159
--- qe.c        15 Mar 2014 22:52:51 -0000      1.158
+++ qe.c        18 Mar 2014 08:20:06 -0000      1.159
@@ -1707,7 +1707,7 @@
         ret = -1;
     b->modified = 0;
     b->save_log = saved;
-    if (!f1)
+    if (!f1 && f)
         fclose(f);
 
     if (ret < 0) {
@@ -3389,7 +3389,6 @@
 }
 
 #define RLE_EMBEDDINGS_SIZE    128
-#define COLORED_MAX_LINE_SIZE  1024
 
 int text_display(EditState *s, DisplayState *ds, int offset)
 {
@@ -3589,7 +3588,7 @@
         s->mode->text_display(s, ds, offset);
         if (m->xc == NO_CURSOR) {
             /* XXX: should not happen */
-            printf("ERROR: cursor not found\n");
+            put_error(NULL, "ERROR: cursor not found");
             ds->y = 0;
         } else {
             ds->y = m->yc + m->cursor_height;
@@ -3653,7 +3652,8 @@
     xc = m->xc;
     yc = m->yc;
 
-    if (s->qe_state->active_window == s) {
+    if (xc != NO_CURSOR && yc != NO_CURSOR
+    &&  s->qe_state->active_window == s) {
         int x, y, w, h;
         x = s->xleft + xc;
         y = s->ytop + yc;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]