mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
updated for version 7.0186
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
" Vim completion script
|
" Vim completion script
|
||||||
" Language: XHTML 1.0 Strict
|
" Language: XHTML 1.0 Strict
|
||||||
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
|
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
|
||||||
" Last Change: 2005 Now 20
|
" Last Change: 2006 Jan 22
|
||||||
|
|
||||||
function! htmlcomplete#CompleteTags(findstart, base)
|
function! htmlcomplete#CompleteTags(findstart, base)
|
||||||
if a:findstart
|
if a:findstart
|
||||||
@@ -31,7 +31,7 @@ function! htmlcomplete#CompleteTags(findstart, base)
|
|||||||
endif
|
endif
|
||||||
if !exists("b:csscompl")
|
if !exists("b:csscompl")
|
||||||
let b:compl_context = getline('.')[0:(compl_begin)]
|
let b:compl_context = getline('.')[0:(compl_begin)]
|
||||||
let b:compl_context = matchstr(b:compl_context, '.*<\zs.*')
|
let b:compl_context = matchstr(b:compl_context, '.*\zs<.*')
|
||||||
else
|
else
|
||||||
let b:compl_context = getline('.')[0:compl_begin]
|
let b:compl_context = getline('.')[0:compl_begin]
|
||||||
endif
|
endif
|
||||||
@@ -42,12 +42,18 @@ function! htmlcomplete#CompleteTags(findstart, base)
|
|||||||
let res2 = []
|
let res2 = []
|
||||||
" a:base is very short - we need context
|
" a:base is very short - we need context
|
||||||
let context = b:compl_context
|
let context = b:compl_context
|
||||||
unlet! b:compl_context
|
|
||||||
" Check if we should do CSS completion inside of <style> tag
|
" Check if we should do CSS completion inside of <style> tag
|
||||||
if exists("b:csscompl")
|
if exists("b:csscompl")
|
||||||
unlet! b:csscompl
|
unlet! b:csscompl
|
||||||
|
let context = b:compl_context
|
||||||
return csscomplete#CompleteCSS(0, context)
|
return csscomplete#CompleteCSS(0, context)
|
||||||
|
else
|
||||||
|
if len(b:compl_context) == 0 && !exists("b:entitiescompl")
|
||||||
|
return []
|
||||||
|
endif
|
||||||
|
let context = matchstr(b:compl_context, '.\zs.*')
|
||||||
endif
|
endif
|
||||||
|
unlet! b:compl_context
|
||||||
" Make entities completion
|
" Make entities completion
|
||||||
if exists("b:entitiescompl")
|
if exists("b:entitiescompl")
|
||||||
unlet! b:entitiescompl
|
unlet! b:entitiescompl
|
||||||
@@ -58,13 +64,25 @@ function! htmlcomplete#CompleteTags(findstart, base)
|
|||||||
|
|
||||||
let entities = g:xmldata_xhtml10s['vimxmlentities']
|
let entities = g:xmldata_xhtml10s['vimxmlentities']
|
||||||
|
|
||||||
for m in entities
|
if len(a:base) == 1
|
||||||
if m =~ '^'.a:base
|
for m in entities
|
||||||
call add(res, m.';')
|
if m =~ '^'.a:base
|
||||||
endif
|
call add(res, m.';')
|
||||||
endfor
|
endif
|
||||||
|
endfor
|
||||||
|
return res
|
||||||
|
else
|
||||||
|
for m in entities
|
||||||
|
if m =~? '^'.a:base
|
||||||
|
call add(res, m.';')
|
||||||
|
elseif m =~? a:base
|
||||||
|
call add(res2, m.';')
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return res + res2
|
||||||
|
endif
|
||||||
|
|
||||||
return res
|
|
||||||
|
|
||||||
endif
|
endif
|
||||||
if context =~ '>'
|
if context =~ '>'
|
||||||
@@ -76,6 +94,7 @@ function! htmlcomplete#CompleteTags(findstart, base)
|
|||||||
return []
|
return []
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
"if context !~ '<$'
|
||||||
|
|
||||||
" Set attribute groups
|
" Set attribute groups
|
||||||
let coreattrs = ["id", "class", "style", "title"]
|
let coreattrs = ["id", "class", "style", "title"]
|
||||||
@@ -456,6 +475,13 @@ function! htmlcomplete#CompleteTags(findstart, base)
|
|||||||
endif
|
endif
|
||||||
" Deal with tag completion.
|
" Deal with tag completion.
|
||||||
let opentag = xmlcomplete#GetLastOpenTag("b:unaryTagsStack")
|
let opentag = xmlcomplete#GetLastOpenTag("b:unaryTagsStack")
|
||||||
|
if opentag == ''
|
||||||
|
" Hack for sometimes failing GetLastOpenTag.
|
||||||
|
" As far as I tested fail isn't GLOT fault but problem
|
||||||
|
" of invalid document - not properly closed tags and other mish-mash.
|
||||||
|
" If returns empty string assume <body>. Safe bet.
|
||||||
|
let opentag = 'body'
|
||||||
|
endif
|
||||||
|
|
||||||
if !exists("g:xmldata_xhtml10s")
|
if !exists("g:xmldata_xhtml10s")
|
||||||
runtime! autoload/xml/xhtml10s.vim
|
runtime! autoload/xml/xhtml10s.vim
|
||||||
|
@@ -2365,7 +2365,7 @@ vgetorpeek(advance)
|
|||||||
colnr_T col = 0, vcol;
|
colnr_T col = 0, vcol;
|
||||||
char_u *ptr;
|
char_u *ptr;
|
||||||
|
|
||||||
if (p_smd)
|
if (p_smd && msg_silent == 0)
|
||||||
{
|
{
|
||||||
unshowmode(TRUE);
|
unshowmode(TRUE);
|
||||||
mode_deleted = TRUE;
|
mode_deleted = TRUE;
|
||||||
@@ -2641,7 +2641,7 @@ vgetorpeek(advance)
|
|||||||
* if we return an ESC to exit insert mode, the message is deleted
|
* if we return an ESC to exit insert mode, the message is deleted
|
||||||
* if we don't return an ESC but deleted the message before, redisplay it
|
* if we don't return an ESC but deleted the message before, redisplay it
|
||||||
*/
|
*/
|
||||||
if (advance && p_smd && (State & INSERT))
|
if (advance && p_smd && msg_silent == 0 && (State & INSERT))
|
||||||
{
|
{
|
||||||
if (c == ESC && !mode_deleted && !no_mapping)
|
if (c == ESC && !mode_deleted && !no_mapping)
|
||||||
{
|
{
|
||||||
|
16
src/normal.c
16
src/normal.c
@@ -1165,6 +1165,7 @@ getcount:
|
|||||||
* Don't redraw the screen, it would remove the message.
|
* Don't redraw the screen, it would remove the message.
|
||||||
*/
|
*/
|
||||||
if ( ((p_smd
|
if ( ((p_smd
|
||||||
|
&& msg_silent == 0
|
||||||
&& (restart_edit != 0
|
&& (restart_edit != 0
|
||||||
#ifdef FEAT_VISUAL
|
#ifdef FEAT_VISUAL
|
||||||
|| (VIsual_active
|
|| (VIsual_active
|
||||||
@@ -1713,7 +1714,7 @@ do_pending_operator(cap, old_col, gui_yank)
|
|||||||
setmouse();
|
setmouse();
|
||||||
mouse_dragging = 0;
|
mouse_dragging = 0;
|
||||||
# endif
|
# endif
|
||||||
if (p_smd)
|
if (p_smd && msg_silent == 0)
|
||||||
clear_cmdline = TRUE; /* unshow visual mode later */
|
clear_cmdline = TRUE; /* unshow visual mode later */
|
||||||
#ifdef FEAT_CMDL_INFO
|
#ifdef FEAT_CMDL_INFO
|
||||||
else
|
else
|
||||||
@@ -2947,7 +2948,8 @@ do_mouse(oap, c, dir, count, fixindent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* If Visual mode changed show it later. */
|
/* If Visual mode changed show it later. */
|
||||||
if (p_smd && (VIsual_active != old_active || VIsual_mode != old_mode))
|
if (p_smd && msg_silent == 0
|
||||||
|
&& (VIsual_active != old_active || VIsual_mode != old_mode))
|
||||||
redraw_cmdline = TRUE;
|
redraw_cmdline = TRUE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -3113,7 +3115,7 @@ end_visual_mode()
|
|||||||
curwin->w_cursor.coladd = 0;
|
curwin->w_cursor.coladd = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (p_smd)
|
if (p_smd && msg_silent == 0)
|
||||||
clear_cmdline = TRUE; /* unshow visual mode later */
|
clear_cmdline = TRUE; /* unshow visual mode later */
|
||||||
#ifdef FEAT_CMDL_INFO
|
#ifdef FEAT_CMDL_INFO
|
||||||
else
|
else
|
||||||
@@ -3644,7 +3646,7 @@ add_to_showcmd(c)
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!p_sc)
|
if (!p_sc || msg_silent != 0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (showcmd_visual)
|
if (showcmd_visual)
|
||||||
@@ -7138,7 +7140,7 @@ nv_visual(cap)
|
|||||||
#ifdef FEAT_MOUSE
|
#ifdef FEAT_MOUSE
|
||||||
setmouse();
|
setmouse();
|
||||||
#endif
|
#endif
|
||||||
if (p_smd)
|
if (p_smd && msg_silent == 0)
|
||||||
redraw_cmdline = TRUE; /* show visual mode later */
|
redraw_cmdline = TRUE; /* show visual mode later */
|
||||||
/*
|
/*
|
||||||
* For V and ^V, we multiply the number of lines even if there
|
* For V and ^V, we multiply the number of lines even if there
|
||||||
@@ -7235,7 +7237,7 @@ n_start_visual_mode(c)
|
|||||||
#ifdef FEAT_MOUSE
|
#ifdef FEAT_MOUSE
|
||||||
setmouse();
|
setmouse();
|
||||||
#endif
|
#endif
|
||||||
if (p_smd)
|
if (p_smd && msg_silent == 0)
|
||||||
redraw_cmdline = TRUE; /* show visual mode later */
|
redraw_cmdline = TRUE; /* show visual mode later */
|
||||||
#ifdef FEAT_CLIPBOARD
|
#ifdef FEAT_CLIPBOARD
|
||||||
/* Make sure the clipboard gets updated. Needed because start and
|
/* Make sure the clipboard gets updated. Needed because start and
|
||||||
@@ -8280,7 +8282,7 @@ nv_normal(cap)
|
|||||||
if (cap->nchar == Ctrl_N || cap->nchar == Ctrl_G)
|
if (cap->nchar == Ctrl_N || cap->nchar == Ctrl_G)
|
||||||
{
|
{
|
||||||
clearop(cap->oap);
|
clearop(cap->oap);
|
||||||
if (restart_edit != 0 && p_smd)
|
if (restart_edit != 0 && p_smd && msg_silent == 0)
|
||||||
clear_cmdline = TRUE; /* unshow mode later */
|
clear_cmdline = TRUE; /* unshow mode later */
|
||||||
restart_edit = 0;
|
restart_edit = 0;
|
||||||
#ifdef FEAT_CMDWIN
|
#ifdef FEAT_CMDWIN
|
||||||
|
Reference in New Issue
Block a user