1
0
forked from aniani/vim

updated for version 7.0187

This commit is contained in:
Bram Moolenaar 2006-01-25 22:02:51 +00:00
parent 7df351eb8a
commit 28c258fd24
8 changed files with 113 additions and 17 deletions

View File

@ -1,13 +1,14 @@
" Vim completion script
" Language: XHTML 1.0 Strict
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
" Last Change: 2006 Jan 22
" Last Change: 2006 Jan 24
function! htmlcomplete#CompleteTags(findstart, base)
if a:findstart
" locate the start of the word
let line = getline('.')
let start = col('.') - 1
let curline = line('.')
let compl_begin = col('.') - 2
while start >= 0 && line[start - 1] =~ '\(\k\|[:.-]\)'
let start -= 1
@ -20,8 +21,7 @@ function! htmlcomplete#CompleteTags(findstart, base)
let stylestart = searchpair('<style\>', '', '<\/style\>', "bnW")
let styleend = searchpair('<style\>', '', '<\/style\>', "nW")
if stylestart != 0 && styleend != 0
let curpos = line('.')
if stylestart <= curpos && styleend >= curpos
if stylestart <= curline && styleend >= curline
let start = col('.') - 1
let b:csscompl = 1
while start >= 0 && line[start - 1] =~ '\(\k\|-\)'
@ -31,6 +31,27 @@ function! htmlcomplete#CompleteTags(findstart, base)
endif
if !exists("b:csscompl")
let b:compl_context = getline('.')[0:(compl_begin)]
if b:compl_context !~ '<[^>]*$'
" Look like we may have broken tag. Check previous lines. Up to
" 10?
let i = 1
while 1
let context_line = getline(curline-i)
if context_line =~ '<[^>]*$'
" Yep, this is this line
let context_lines = getline(curline-i, curline)
let b:compl_context = join(context_lines, ' ')
break
elseif context_line =~ '>[^<]*$'
" Normal tag line, no need for completion at all
let b:compl_context = ''
break
endif
let i += 1
endwhile
" Make sure we don't have counter
unlet! i
endif
let b:compl_context = matchstr(b:compl_context, '.*\zs<.*')
else
let b:compl_context = getline('.')[0:compl_begin]
@ -94,7 +115,6 @@ function! htmlcomplete#CompleteTags(findstart, base)
return []
endif
endif
"if context !~ '<$'
" Set attribute groups
let coreattrs = ["id", "class", "style", "title"]

View File

@ -1213,23 +1213,45 @@ The commands are sorted on the non-optional part of their name.
|:keepalt| :keepa[lt] following command keeps the alternate file
|:keepmarks| :kee[pmarks] following command keeps marks where they are
|:keepjumps| :keepj[jumps] following command keeps jumplist and marks
|:lNext| :lN[ext] go to previous entry in location list
|:lNfile| :lNf[ile] go to last entry in previous file
|:list| :l[ist] print lines
|:laddexpr| :lad[dexpr] add locations from expr
|:laddfile| :laddf[ile] add locations to current location list
|:last| :la[st] go to the last file in the argument list
|:language| :lan[guage] set the language (locale)
|:lbuffer| :lb[uffer] parse locations and jump to first location
|:lcd| :lc[d] change directory locally
|:lchdir| :lch[dir] change directory locally
|:lclose| :lcl[ose] close location window
|:left| :le[ft] left align lines
|:leftabove| :lefta[bove] make split window appear left or above
|:let| :let assign a value to a variable or option
|:lexpr| :lex[pr] read locations from expr and jump to first
|:lfile| :lf[ile] read file with locations and jump to first
|:lfirst| :lfir[st] go to the specified location, default first one
|:lgetfile| :lg[etfile] read file with locations
|:ll| :ll go to specific location
|:llast| :lla[st] go to the specified location, default last one
|:llist| :lli[st] list all locations
|:lmap| :lm[ap] like ":map!" but includes Lang-Arg mode
|:lmapclear| :lmapc[lear] like ":mapclear!" but includes Lang-Arg mode
|:lnext| :ln[ext] go to next location
|:lnewer| :lnew[er] go to newer location list
|:lnfile| :lnf[ile] go to first location in next file
|:lnoremap| :ln[oremap] like ":noremap!" but includes Lang-Arg mode
|:loadkeymap| :loadk[eymap] load the following keymaps until EOF
|:loadview| :lo[adview] load view for current window from a file
|:lockmarks| :loc[kmarks] following command keeps marks where they are
|:lockvar| :lockv[ar] lock variables
|:lolder| :lol[der] go to older location list
|:lopen| :lope[n] open location window
|:lprevious| :lp[revious] go to previous location
|:lpfile| :lpf[ile] go to last location in previous file
|:lrewind| :lr[ewind] go to the specified location, default first one
|:ls| :ls list all buffers
|:lunmap| :lu[nmap] like ":unmap!" but includes Lang-Arg mode
|:lwindow| :lw[indow] open or close location window
|:move| :m[ove] move lines
|:mark| :ma[rk] set a mark
|:make| :mak[e] execute external command 'makeprg' and parse

View File

@ -0,0 +1,22 @@
" Vim script to clean the ll.xxxxx.add files of commented out entries
" Author: Antonio Colombo, Bram Moolenaar
" Last Update: 2006 Jan 19
" Time in seconds after last time an ll.xxxxx.add file was updated
" Default is one hour.
if !exists("g:spell_clean_limit")
let g:spell_clean_limit = 60 * 60
endif
" Loop over all the runtime/spell/*.add files.
for s:fname in split(globpath(&rtp, "spell/*.add"), "\n")
if filewritable(s:fname) && localtime() - getftime(s:fname) > g:spell_clean_limit
silent exe "split " . escape(s:fname, ' \')
echo "Processing" s:fname
silent! g/^#/d
silent update
close
endif
endfor
echo "Done"

View File

@ -4758,7 +4758,21 @@ buf_spname(buf)
{
#if defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)
if (bt_quickfix(buf))
return _("[Error List]");
{
win_T *win;
/*
* For location list window, w_llist_ref points to the location list.
* For quickfix window, w_llist_ref is NULL.
*/
FOR_ALL_WINDOWS(win)
if (win->w_buffer == buf)
break;
if (win != NULL && win->w_llist_ref != NULL)
return _("[Location List]");
else
return _("[Error List]");
}
#endif
#ifdef FEAT_QUICKFIX
/* There is no _file_ when 'buftype' is "nofile", b_sfname

View File

@ -2365,7 +2365,7 @@ vgetorpeek(advance)
colnr_T col = 0, vcol;
char_u *ptr;
if (p_smd && msg_silent == 0)
if (mode_displayed)
{
unshowmode(TRUE);
mode_deleted = TRUE;
@ -2643,7 +2643,7 @@ vgetorpeek(advance)
*/
if (advance && p_smd && msg_silent == 0 && (State & INSERT))
{
if (c == ESC && !mode_deleted && !no_mapping)
if (c == ESC && !mode_deleted && !no_mapping && mode_displayed)
{
if (typebuf.tb_len && !KeyTyped)
redraw_cmdline = TRUE; /* delete mode later */

View File

@ -1004,7 +1004,10 @@ mark_adjust(line1, line2, amount, amount_after)
#ifdef FEAT_QUICKFIX
/* quickfix marks */
qf_mark_adjust(line1, line2, amount, amount_after);
qf_mark_adjust(NULL, line1, line2, amount, amount_after);
/* location lists */
FOR_ALL_WINDOWS(win)
qf_mark_adjust(win, line1, line2, amount, amount_after);
#endif
#ifdef FEAT_SIGNS

View File

@ -1714,7 +1714,7 @@ do_pending_operator(cap, old_col, gui_yank)
setmouse();
mouse_dragging = 0;
# endif
if (p_smd && msg_silent == 0)
if (mode_displayed)
clear_cmdline = TRUE; /* unshow visual mode later */
#ifdef FEAT_CMDL_INFO
else
@ -2779,7 +2779,10 @@ do_mouse(oap, c, dir, count, fixindent)
{
if (State & INSERT)
stuffcharReadbuff(Ctrl_O);
stuffReadbuff((char_u *)":.cc\n");
if (curwin->w_llist_ref == NULL) /* quickfix window */
stuffReadbuff((char_u *)":.cc\n");
else /* location list window */
stuffReadbuff((char_u *)":.ll\n");
got_click = FALSE; /* ignore drag&release now */
}
#endif
@ -2948,8 +2951,9 @@ do_mouse(oap, c, dir, count, fixindent)
}
/* If Visual mode changed show it later. */
if (p_smd && msg_silent == 0
&& (VIsual_active != old_active || VIsual_mode != old_mode))
if ((!VIsual_active && old_active && mode_displayed)
|| (VIsual_active && p_smd && msg_silent == 0
&& (!old_active || VIsual_mode != old_mode)))
redraw_cmdline = TRUE;
#endif
@ -3115,7 +3119,7 @@ end_visual_mode()
curwin->w_cursor.coladd = 0;
#endif
if (p_smd && msg_silent == 0)
if (mode_displayed)
clear_cmdline = TRUE; /* unshow visual mode later */
#ifdef FEAT_CMDL_INFO
else
@ -5713,7 +5717,10 @@ nv_down(cap)
#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
/* In a quickfix window a <CR> jumps to the error under the cursor. */
if (bt_quickfix(curbuf) && cap->cmdchar == CAR)
do_cmdline_cmd((char_u *)".cc");
if (curwin->w_llist_ref == NULL)
do_cmdline_cmd((char_u *)".cc"); /* quickfix window */
else
do_cmdline_cmd((char_u *)".ll"); /* location list window */
else
#endif
{
@ -8282,7 +8289,7 @@ nv_normal(cap)
if (cap->nchar == Ctrl_N || cap->nchar == Ctrl_G)
{
clearop(cap->oap);
if (restart_edit != 0 && p_smd && msg_silent == 0)
if (restart_edit != 0 && mode_displayed)
clear_cmdline = TRUE; /* unshow mode later */
restart_edit = 0;
#ifdef FEAT_CMDWIN

View File

@ -518,8 +518,9 @@ newwindow:
*/
if (bt_quickfix(curbuf))
{
sprintf((char *)cbuf, "split +%ldcc",
(long)curwin->w_cursor.lnum);
sprintf((char *)cbuf, "split +%ld%s",
(long)curwin->w_cursor.lnum,
(curwin->w_llist_ref == NULL) ? "cc" : "ll");
do_cmdline_cmd(cbuf);
}
#endif
@ -816,6 +817,9 @@ win_split_ins(size, flags, newwin, dir)
wp->w_prev_fraction_row = curwin->w_prev_fraction_row;
#ifdef FEAT_JUMPLIST
copy_jumplist(curwin, wp);
#endif
#ifdef FEAT_QUICKFIX
copy_loclist(curwin, wp);
#endif
if (curwin->w_localdir != NULL)
wp->w_localdir = vim_strsave(curwin->w_localdir);
@ -3182,6 +3186,10 @@ win_free(wp)
free_jumplist(wp);
#endif
#ifdef FEAT_QUICKFIX
qf_free_all(wp);
#endif
#ifdef FEAT_GUI
if (gui.in_use)
{