Skip to content

Commit

Permalink
updated for version 7.0060
Browse files Browse the repository at this point in the history
  • Loading branch information
vimboss committed Mar 15, 2005
1 parent 57f5d66 commit 21fd6c1
Show file tree
Hide file tree
Showing 14 changed files with 1,356 additions and 1,328 deletions.
9 changes: 4 additions & 5 deletions runtime/syntax/prolog.vim
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
" Vim syntax file
" Language: PROLOG
" Maintainers: Ralph Becket <rwab1@cam.sri.co.uk>,
" Thomas Koehler <jean-luc@picard.franken.de>
" Last Change: 2003 May 11
" URL: http://jeanluc-picard.de/vim/syntax/prolog.vim
" Maintainers: Thomas Koehler <jean-luc@picard.franken.de>
" Last Change: 2005 Mar 14
" URL: http://gott-gehabt/800_wer_wir_sind/thomas/Homepage/Computer/vim/syntax/prolog.vim

" There are two sets of highlighting in here:
" If the "prolog_highlighting_clean" variable exists, it is rather sparse.
Expand Down Expand Up @@ -73,7 +72,7 @@ if !exists("prolog_highlighting_clean")

endif

syn sync ccomment maxlines=50
syn sync maxlines=50


" Define the default highlighting.
Expand Down
1 change: 1 addition & 0 deletions src/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,7 @@ EXTERN char_u *new_last_cmdline INIT(= NULL); /* new value for last_cmdline */
EXTERN char_u *autocmd_fname INIT(= NULL); /* fname for <afile> on cmdline */
EXTERN int autocmd_bufnr INIT(= 0); /* fnum for <abuf> on cmdline */
EXTERN char_u *autocmd_match INIT(= NULL); /* name for <amatch> on cmdline */
EXTERN int did_cursorhold INIT(= FALSE); /* set when CursorHold triggered */
#endif

EXTERN linenr_T write_no_eol_lnum INIT(= 0); /* non-zero lnum when last line
Expand Down
101 changes: 41 additions & 60 deletions src/gui.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ static void fill_mouse_coord __ARGS((char_u *p, int col, int row));
static void gui_do_scrollbar __ARGS((win_T *wp, int which, int enable));
static colnr_T scroll_line_len __ARGS((linenr_T lnum));
static void gui_update_horiz_scrollbar __ARGS((int));
static void gui_set_fg_color __ARGS((char_u *name));
static void gui_set_bg_color __ARGS((char_u *name));
static win_T *xy2win __ARGS((int x, int y));

static int can_update_cursor = TRUE; /* can display the cursor */
Expand Down Expand Up @@ -1941,6 +1943,7 @@ gui_outstr_nowrap(s, len, flags, fg, bg, back)
long_u hl_mask_todo;
guicolor_T fg_color;
guicolor_T bg_color;
guicolor_T sp_color;
#if !defined(MSWIN16_FASTTEXT) && !defined(HAVE_GTK2) && !defined(FEAT_GUI_KDE)
GuiFont font = NOFONT;
# ifdef FEAT_XFONTSET
Expand Down Expand Up @@ -2050,6 +2053,7 @@ gui_outstr_nowrap(s, len, flags, fg, bg, back)
draw_flags |= DRAW_CURSOR;
fg_color = fg;
bg_color = bg;
sp_color = fg;
}
else if (aep != NULL)
{
Expand All @@ -2059,9 +2063,15 @@ gui_outstr_nowrap(s, len, flags, fg, bg, back)
bg_color = aep->ae_u.gui.bg_color;
if (bg_color == INVALCOLOR)
bg_color = gui.back_pixel;
sp_color = aep->ae_u.gui.sp_color;
if (sp_color == INVALCOLOR)
sp_color = fg_color;
}
else
{
fg_color = gui.norm_pixel;
sp_color = fg_color;
}

if (highlight_mask & (HL_INVERSE | HL_STANDOUT))
{
Expand All @@ -2081,6 +2091,7 @@ gui_outstr_nowrap(s, len, flags, fg, bg, back)
gui_mch_set_bg_color(bg_color);
#endif
}
gui_mch_set_sp_color(sp_color);

/* Clear the selection if we are about to write over it */
if (!(flags & GUI_MON_NOCLEAR))
Expand Down Expand Up @@ -2119,6 +2130,9 @@ gui_outstr_nowrap(s, len, flags, fg, bg, back)
)
draw_flags |= DRAW_UNDERL;
#endif
/* Do we undercurl the text? */
if (hl_mask_todo & HL_UNDERCURL)
draw_flags |= DRAW_UNDERC;

/* Do we draw transparantly? */
if (flags & GUI_MON_TRS_CURSOR)
Expand Down Expand Up @@ -2364,7 +2378,7 @@ gui_redraw_block(row1, col1, row2, col2, flags)
int old_row, old_col;
long_u old_hl_mask;
int off;
char_u first_attr;
sattr_T first_attr;
int idx, len;
int back, nback;
int retval = FALSE;
Expand Down Expand Up @@ -2588,9 +2602,6 @@ gui_wait_for_chars(wtime)
long wtime;
{
int retval;
#ifdef FEAT_AUTOCMD
static int once_already = 0;
#endif

/*
* If we're going to wait a bit, update the menus and mouse shape for the
Expand All @@ -2605,19 +2616,9 @@ gui_wait_for_chars(wtime)

gui_mch_update();
if (input_available()) /* Got char, return immediately */
{
#ifdef FEAT_AUTOCMD
once_already = 0;
#endif
return OK;
}
if (wtime == 0) /* Don't wait for char */
{
#ifdef FEAT_AUTOCMD
once_already = 0;
#endif
return FAIL;
}

/* Before waiting, flush any output to the screen. */
gui_mch_flush();
Expand All @@ -2629,9 +2630,6 @@ gui_wait_for_chars(wtime)
gui_mch_start_blink();
retval = gui_mch_wait_for_chars(wtime);
gui_mch_stop_blink();
#ifdef FEAT_AUTOCMD
once_already = 0;
#endif
return retval;
}

Expand All @@ -2640,53 +2638,36 @@ gui_wait_for_chars(wtime)
*/
gui_mch_start_blink();


retval = FAIL;
/*
* We may want to trigger the CursorHold event. First wait for
* 'updatetime' and if nothing is typed within that time put the
* K_CURSORHOLD key in the input buffer.
*/
if (gui_mch_wait_for_chars(p_ut) == OK)
retval = OK;
#ifdef FEAT_AUTOCMD
/* If there is no character available within 2 seconds (default),
* write the autoscript file to disk */
if (once_already == 2)
else if (!did_cursorhold && has_cursorhold()
&& get_real_state() == NORMAL_BUSY)
{
updatescript(0);
retval = gui_mch_wait_for_chars(-1L);
once_already = 0;
}
else if (once_already == 1)
{
setcursor();
once_already = 2;
retval = 0;
char_u buf[3];

/* Put K_CURSORHOLD in the input buffer. */
buf[0] = CSI;
buf[1] = KS_EXTRA;
buf[2] = (int)KE_CURSORHOLD;
add_to_input_buf(buf, 3);

retval = OK;
}
else
#endif
if (gui_mch_wait_for_chars(p_ut) != OK)
{
#ifdef FEAT_AUTOCMD
if (has_cursorhold() && get_real_state() == NORMAL_BUSY)
{
apply_autocmds(EVENT_CURSORHOLD, NULL, NULL, FALSE, curbuf);
update_screen(VALID);
showruler(FALSE);
setcursor();
/* In case the commands moved the focus to another window
* (temporarily). */
if (need_mouse_correct)
gui_mouse_correct();

once_already = 1;
retval = 0;
}
else
#endif
{
updatescript(0);
retval = gui_mch_wait_for_chars(-1L);
#ifdef FEAT_AUTOCMD
once_already = 0;
#endif
}
if (retval == FAIL)
{
/* Blocking wait. */
updatescript(0);
retval = gui_mch_wait_for_chars(-1L);
}
else
retval = OK;

gui_mch_stop_blink();
return retval;
Expand Down Expand Up @@ -4067,15 +4048,15 @@ gui_check_colors()
}
}

void
static void
gui_set_fg_color(name)
char_u *name;
{
gui.norm_pixel = gui_get_color(name);
hl_set_fg_color_name(vim_strsave(name));
}

void
static void
gui_set_bg_color(name)
char_u *name;
{
Expand Down
7 changes: 5 additions & 2 deletions src/gui.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,11 @@ class VimWidget;
#define DRAW_TRANSP 0x01 /* draw with transparant bg */
#define DRAW_BOLD 0x02 /* draw bold text */
#define DRAW_UNDERL 0x04 /* draw underline text */
#define DRAW_UNDERC 0x08 /* draw undercurl text */
#if defined(RISCOS) || defined(HAVE_GTK2) || defined (FEAT_GUI_KDE)
# define DRAW_ITALIC 0x08 /* draw italic text */
# define DRAW_ITALIC 0x10 /* draw italic text */
#endif
#define DRAW_CURSOR 0x10 /* drawing block cursor (win32) */
#define DRAW_CURSOR 0x20 /* drawing block cursor (win32) */

/* For our own tearoff menu item */
#define TEAR_STRING "-->Detach"
Expand Down Expand Up @@ -421,6 +422,7 @@ typedef struct Gui
# endif
GdkColor *fgcolor; /* GDK-styled foreground color */
GdkColor *bgcolor; /* GDK-styled background color */
GdkColor *spcolor; /* GDK-styled special color */
# ifndef HAVE_GTK2
GuiFont current_font;
# endif
Expand Down Expand Up @@ -463,6 +465,7 @@ typedef struct Gui
GuiFont currFont; /* Current font */
guicolor_T currFgColor; /* Current foreground text color */
guicolor_T currBgColor; /* Current background text color */
guicolor_T currSpColor; /* Current special text color */
#endif

#ifdef FEAT_GUI_MAC
Expand Down
12 changes: 9 additions & 3 deletions src/gui_w16.c
Original file line number Diff line number Diff line change
Expand Up @@ -584,9 +584,6 @@ gui_mch_set_font(GuiFont font)
SelectFont(s_hdc, gui.currFont);
}




/*
* Set the current text foreground color.
*/
Expand All @@ -610,6 +607,15 @@ gui_mch_set_bg_color(guicolor_T color)
SetBkColor(s_hdc, gui.currBgColor);
}

/*
* Set the current text special color.
*/
void
gui_mch_set_sp_color(guicolor_T color)
{
/* TODO */
}



void
Expand Down
3 changes: 3 additions & 0 deletions src/keymap.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ enum key_extra
, KE_X2RELEASE

, KE_DROP /* DnD data is available */
, KE_CURSORHOLD /* CursorHold event */
};

/*
Expand Down Expand Up @@ -463,6 +464,8 @@ enum key_extra

#define K_DROP TERMCAP2KEY(KS_EXTRA, KE_DROP)

#define K_CURSORHOLD TERMCAP2KEY(KS_EXTRA, KE_CURSORHOLD)

/* Bits for modifier mask */
/* 0x01 cannot be used, because the modifier must be 0x02 or higher */
#define MOD_MASK_SHIFT 0x02
Expand Down
26 changes: 26 additions & 0 deletions src/normal.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ static void nv_nbcmd __ARGS((cmdarg_T *cap));
#ifdef FEAT_DND
static void nv_drop __ARGS((cmdarg_T *cap));
#endif
#ifdef FEAT_AUTOCMD
static void nv_cursorhold __ARGS((cmdarg_T *cap));
#endif

/*
* Function to be called for a Normal or Visual mode command.
Expand Down Expand Up @@ -434,6 +437,9 @@ static const struct nv_cmd
#ifdef FEAT_DND
{K_DROP, nv_drop, NV_STS, 0},
#endif
#ifdef FEAT_AUTOCMD
{K_CURSORHOLD, nv_cursorhold, 0, 0},
#endif
};

/* Number of commands in nv_cmds[]. */
Expand Down Expand Up @@ -1077,6 +1083,9 @@ normal_cmd(oap, toplevel)
if (need_flushbuf)
out_flush();
#endif
#ifdef FEAT_AUTOCMD
did_cursorhold = FALSE;
#endif

State = NORMAL;

Expand Down Expand Up @@ -8652,3 +8661,20 @@ nv_drop(cap)
do_put('~', BACKWARD, 1L, PUT_CURSEND);
}
#endif

#ifdef FEAT_AUTOCMD
/*
* Trigger CursorHold event.
* When waiting for a character for 'updatetime' K_CURSORHOLD is put in the
* input buffer. "did_cursorhold" is set to avoid retriggering.
*/
/*ARGSUSED*/
static void
nv_cursorhold(cap)
cmdarg_T *cap;
{
apply_autocmds(EVENT_CURSORHOLD, NULL, NULL, FALSE, curbuf);
did_cursorhold = TRUE;
}
#endif

Loading

0 comments on commit 21fd6c1

Please sign in to comment.