syntax highlighting for perl plus syntax highlighting fixes.
Этот коммит содержится в:
родитель
2ea209b24d
Коммит
cf16bf846b
@ -38,9 +38,7 @@
|
|||||||
# include <sys/stat.h>
|
# include <sys/stat.h>
|
||||||
# include <errno.h>
|
# include <errno.h>
|
||||||
|
|
||||||
# ifdef HAVE_FCNTL_H
|
# include <fcntl.h>
|
||||||
# include <fcntl.h>
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# include <stdlib.h>
|
# include <stdlib.h>
|
||||||
# include <malloc.h>
|
# include <malloc.h>
|
||||||
@ -304,14 +302,17 @@ struct context_rule {
|
|||||||
int between_delimiters;
|
int between_delimiters;
|
||||||
char *whole_word_chars_left;
|
char *whole_word_chars_left;
|
||||||
char *whole_word_chars_right;
|
char *whole_word_chars_right;
|
||||||
unsigned char *conflicts;
|
|
||||||
char *keyword_first_chars;
|
char *keyword_first_chars;
|
||||||
char *keyword_last_chars;
|
char *keyword_last_chars;
|
||||||
/* first word is word[1] */
|
/* first word is word[1] */
|
||||||
struct key_word **keyword;
|
struct key_word **keyword;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct _syntax_marker {
|
||||||
|
long offset;
|
||||||
|
unsigned long rule;
|
||||||
|
struct _syntax_marker *next;
|
||||||
|
};
|
||||||
|
|
||||||
struct editor_widget {
|
struct editor_widget {
|
||||||
#ifdef MIDNIGHT
|
#ifdef MIDNIGHT
|
||||||
@ -375,6 +376,12 @@ struct editor_widget {
|
|||||||
int column2; /*position of column highlight end */
|
int column2; /*position of column highlight end */
|
||||||
long bracket; /*position of a matching bracket */
|
long bracket; /*position of a matching bracket */
|
||||||
|
|
||||||
|
/* cache speedup for line lookups */
|
||||||
|
#define N_LINE_CACHES 32
|
||||||
|
int caches_valid;
|
||||||
|
int line_numbers[N_LINE_CACHES];
|
||||||
|
long line_offsets[N_LINE_CACHES];
|
||||||
|
|
||||||
/* undo stack and pointers */
|
/* undo stack and pointers */
|
||||||
unsigned long stack_pointer;
|
unsigned long stack_pointer;
|
||||||
long *undo_stack;
|
long *undo_stack;
|
||||||
@ -384,6 +391,7 @@ struct editor_widget {
|
|||||||
struct stat stat;
|
struct stat stat;
|
||||||
|
|
||||||
/* syntax higlighting */
|
/* syntax higlighting */
|
||||||
|
struct _syntax_marker *syntax_marker;
|
||||||
struct context_rule **rules;
|
struct context_rule **rules;
|
||||||
long last_get_rule;
|
long last_get_rule;
|
||||||
unsigned long rule;
|
unsigned long rule;
|
||||||
|
@ -260,7 +260,11 @@ int edit_save_file (WEdit * edit, const char *filename)
|
|||||||
return 0;
|
return 0;
|
||||||
savedir[slashpos - filename + 1] = '\0';
|
savedir[slashpos - filename + 1] = '\0';
|
||||||
}
|
}
|
||||||
|
#ifdef HAVE_MAD
|
||||||
|
savename = strdup (tempnam (savedir, "cooledit"));
|
||||||
|
#else
|
||||||
savename = tempnam (savedir, "cooledit");
|
savename = tempnam (savedir, "cooledit");
|
||||||
|
#endif
|
||||||
if (slashpos)
|
if (slashpos)
|
||||||
free (savedir);
|
free (savedir);
|
||||||
if (!savename)
|
if (!savename)
|
||||||
|
@ -461,10 +461,8 @@ void render_edit_text (WEdit * edit, long start_row, long start_column, long end
|
|||||||
{
|
{
|
||||||
long row = 0, curs_row;
|
long row = 0, curs_row;
|
||||||
static int prev_curs_row = 0;
|
static int prev_curs_row = 0;
|
||||||
static long prev_start_display = 0;
|
|
||||||
static int prev_start_col = 0;
|
static int prev_start_col = 0;
|
||||||
static long prev_curs = 0;
|
static long prev_curs = 0;
|
||||||
unsigned long syntax_rule;
|
|
||||||
|
|
||||||
#ifndef MIDNIGHT
|
#ifndef MIDNIGHT
|
||||||
static unsigned long prev_win = 0;
|
static unsigned long prev_win = 0;
|
||||||
@ -474,9 +472,6 @@ void render_edit_text (WEdit * edit, long start_row, long start_column, long end
|
|||||||
int force = edit->force;
|
int force = edit->force;
|
||||||
long b;
|
long b;
|
||||||
|
|
||||||
edit_get_syntax_color (edit, edit->start_display - 1, &fg, &bg);
|
|
||||||
syntax_rule = edit->rule;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if the position of the page has not moved then we can draw the cursor character only.
|
if the position of the page has not moved then we can draw the cursor character only.
|
||||||
This will prevent line flicker when using arrow keys.
|
This will prevent line flicker when using arrow keys.
|
||||||
@ -580,7 +575,6 @@ void render_edit_text (WEdit * edit, long start_row, long start_column, long end
|
|||||||
|
|
||||||
prev_curs_row = edit->curs_row;
|
prev_curs_row = edit->curs_row;
|
||||||
prev_curs = edit->curs1;
|
prev_curs = edit->curs1;
|
||||||
prev_start_display = edit->start_display;
|
|
||||||
prev_start_col = edit->start_col;
|
prev_start_col = edit->start_col;
|
||||||
#ifndef MIDNIGHT
|
#ifndef MIDNIGHT
|
||||||
#ifdef GTK
|
#ifdef GTK
|
||||||
@ -590,8 +584,6 @@ void render_edit_text (WEdit * edit, long start_row, long start_column, long end
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
exit_render:
|
exit_render:
|
||||||
edit->last_get_rule = edit->start_display - 1;
|
|
||||||
edit->rule = syntax_rule;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
3863
gtkedit/syntax.c
3863
gtkedit/syntax.c
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Загрузка…
x
Ссылка в новой задаче
Block a user