mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
updated for version 7.0212
This commit is contained in:
@@ -393,6 +393,7 @@ os_risc.txt:
|
|||||||
os_win32.txt:
|
os_win32.txt:
|
||||||
touch os_win32.txt
|
touch os_win32.txt
|
||||||
|
|
||||||
|
# Note that $< works with GNU make while $> works for BSD make.
|
||||||
vim-fr.UTF-8.1: vim-fr.1
|
vim-fr.UTF-8.1: vim-fr.1
|
||||||
iconv -f latin1 -t utf-8 $< >$@
|
iconv -f latin1 -t utf-8 $< >$@
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
*os_vms.txt* For Vim version 7.0aa. Last change: 2005 Jul 12
|
*os_vms.txt* For Vim version 7.0aa. Last change: 2006 Mar 02
|
||||||
|
|
||||||
|
|
||||||
VIM REFERENCE MANUAL
|
VIM REFERENCE MANUAL
|
||||||
@@ -56,11 +56,14 @@ To use the precompiled binary version, you need one of these archives:
|
|||||||
vim-XX-exe-vax-gui.zip VAX GUI executables
|
vim-XX-exe-vax-gui.zip VAX GUI executables
|
||||||
vim-XX-exe-vax-term.zip VAX console executables
|
vim-XX-exe-vax-term.zip VAX console executables
|
||||||
|
|
||||||
and of course
|
and of course (optional)
|
||||||
vim-XX-runtime.zip runtime files
|
vim-XX-runtime.zip runtime files
|
||||||
|
|
||||||
The binary archives contain: vim.exe, ctags.exe, xxd.exe files.
|
The binary archives contain: vim.exe, ctags.exe, xxd.exe files.
|
||||||
|
|
||||||
|
For GTK executables you will need GTKLIB that is available for
|
||||||
|
Alpha and IA64 platform.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
|
||||||
3. Compiling *vms-compiling*
|
3. Compiling *vms-compiling*
|
||||||
@@ -121,10 +124,10 @@ Vim uses a special directory structure to hold the document and runtime files:
|
|||||||
|- vim57
|
|- vim57
|
||||||
|----- doc
|
|----- doc
|
||||||
|----- syntax
|
|----- syntax
|
||||||
|- vim60
|
|- vim62
|
||||||
|----- doc
|
|----- doc
|
||||||
|----- syntax
|
|----- syntax
|
||||||
|- vim61
|
|- vim64
|
||||||
|----- doc
|
|----- doc
|
||||||
|----- syntax
|
|----- syntax
|
||||||
vimrc (system rc files)
|
vimrc (system rc files)
|
||||||
@@ -239,6 +242,17 @@ and to the SYS$STARTUP:SYLOGIN.COM >
|
|||||||
|
|
||||||
It will set up a normal Vim work environment for every user on the system.
|
It will set up a normal Vim work environment for every user on the system.
|
||||||
|
|
||||||
|
IMPORTANT: Vim on OpenVMS (and on other case insensitive system) command line
|
||||||
|
parameters are assumed to be lowecase. In order to indicate that a command
|
||||||
|
line parameter is uppercase "/" sign must be used.
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
>
|
||||||
|
vim -R filename ! means: -r List swap files and exit
|
||||||
|
vim -/r filename ! means: -R Readonly mode (like "view")
|
||||||
|
vim -u <vimrc> ! means: -u Use <vimrc> instead of any .vimrc
|
||||||
|
vim -/u <gvimrc> ! means: -U Use <gvimrc> instead of any .gvimrc
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
|
||||||
7. GUI mode questions *vms-gui*
|
7. GUI mode questions *vms-gui*
|
||||||
@@ -653,7 +667,10 @@ start it with: >
|
|||||||
|
|
||||||
9. VMS related changes *vms-changes*
|
9. VMS related changes *vms-changes*
|
||||||
|
|
||||||
Version 7.0
|
Version 7
|
||||||
|
- Improved low level char input (affects just console mode)
|
||||||
|
|
||||||
|
Version 6.4 (2005 Oct 15)
|
||||||
- GTKLIB and Vim build on IA64
|
- GTKLIB and Vim build on IA64
|
||||||
- colors in terminal mode
|
- colors in terminal mode
|
||||||
- syntax highlighting in terminal mode
|
- syntax highlighting in terminal mode
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
INSTALLvms.txt - Installation of Vim on OpenVMS
|
INSTALLvms.txt - Installation of Vim on OpenVMS
|
||||||
|
|
||||||
Maintainer: Zoltan Arpadffy <arpadffy@polarhome.com>
|
Maintainer: Zoltan Arpadffy <arpadffy@polarhome.com>
|
||||||
Last change: 2005 Jul 12
|
Last change: 2006 Mar 02
|
||||||
|
|
||||||
This file contains instructions for compiling Vim on Openvms.
|
This file contains instructions for compiling Vim on Openvms.
|
||||||
If you already have an executable version of Vim, you don't need this.
|
If you already have an executable version of Vim, you don't need this.
|
||||||
@@ -143,7 +143,6 @@ from CVS mirror ftp://ftp.polarhome.com/pub/cvs/SOURCE/
|
|||||||
Uncommented - build without support.
|
Uncommented - build without support.
|
||||||
Default : Uncommented
|
Default : Uncommented
|
||||||
|
|
||||||
|
|
||||||
Parameter name : VIM_XIM
|
Parameter name : VIM_XIM
|
||||||
Description : X Input Method. For entering special languages
|
Description : X Input Method. For entering special languages
|
||||||
like chinese and Japanese. Please define just
|
like chinese and Japanese. Please define just
|
||||||
@@ -304,9 +303,20 @@ perl_env :
|
|||||||
You need also the OpenVMS Porting Library:
|
You need also the OpenVMS Porting Library:
|
||||||
http://www.openvms.compaq.com/openvms/products/ips/porting.html
|
http://www.openvms.compaq.com/openvms/products/ips/porting.html
|
||||||
|
|
||||||
|
Source code for GTK and porting library that is used to build
|
||||||
|
VMS executables at polarhome.com are at
|
||||||
|
http://www.polarhome.com/vim/files/source/vms/
|
||||||
|
|
||||||
Enable GTK in make_vms.mms file with GTK = YES
|
Enable GTK in make_vms.mms file with GTK = YES
|
||||||
Define GTK_ROOT that points to your GTK root directory.
|
Define GTK_ROOT that points to your GTK root directory.
|
||||||
|
|
||||||
|
You will need to edit GTKDIR variable in order to point
|
||||||
|
to GTK header files and libraries.
|
||||||
|
|
||||||
|
GTK_DIR = ALPHA$DKA0:[GTK128.]
|
||||||
|
|
||||||
|
".]" at the end is very important.
|
||||||
|
|
||||||
Build it as normally.
|
Build it as normally.
|
||||||
|
|
||||||
Used sharable images are:
|
Used sharable images are:
|
||||||
|
40
src/buffer.c
40
src/buffer.c
@@ -4453,6 +4453,9 @@ ex_buffer_all(eap)
|
|||||||
|| ((cmdmod.split & WSP_VERT)
|
|| ((cmdmod.split & WSP_VERT)
|
||||||
? wp->w_height + wp->w_status_height < Rows - p_ch
|
? wp->w_height + wp->w_status_height < Rows - p_ch
|
||||||
: wp->w_width != Columns)
|
: wp->w_width != Columns)
|
||||||
|
#endif
|
||||||
|
#ifdef FEAT_WINDOWS
|
||||||
|
|| (had_tab > 0 && wp != firstwin)
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@@ -4460,6 +4463,7 @@ ex_buffer_all(eap)
|
|||||||
#ifdef FEAT_AUTOCMD
|
#ifdef FEAT_AUTOCMD
|
||||||
wpnext = firstwin; /* just in case an autocommand does
|
wpnext = firstwin; /* just in case an autocommand does
|
||||||
something strange with windows */
|
something strange with windows */
|
||||||
|
tpnext = first_tabpage; /* start all over...*/
|
||||||
open_wins = 0;
|
open_wins = 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -4471,12 +4475,6 @@ ex_buffer_all(eap)
|
|||||||
/* Without the ":tab" modifier only do the current tab page. */
|
/* Without the ":tab" modifier only do the current tab page. */
|
||||||
if (had_tab == 0 || tpnext == NULL)
|
if (had_tab == 0 || tpnext == NULL)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
# ifdef FEAT_AUTOCMD
|
|
||||||
/* check if autocommands removed the next tab page */
|
|
||||||
if (!valid_tabpage(tpnext))
|
|
||||||
tpnext = first_tabpage; /* start all over...*/
|
|
||||||
# endif
|
|
||||||
goto_tabpage_tp(tpnext);
|
goto_tabpage_tp(tpnext);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -4500,14 +4498,28 @@ ex_buffer_all(eap)
|
|||||||
if ((!all && buf->b_ml.ml_mfp == NULL) || !buf->b_p_bl)
|
if ((!all && buf->b_ml.ml_mfp == NULL) || !buf->b_p_bl)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* Check if this buffer already has a window */
|
#ifdef FEAT_WINDOWS
|
||||||
for (wp = firstwin; wp != NULL; wp = wp->w_next)
|
if (had_tab != 0)
|
||||||
if (wp->w_buffer == buf)
|
{
|
||||||
break;
|
/* With the ":tab" modifier don't move the window. */
|
||||||
/* If the buffer already has a window, move it */
|
if (buf->b_nwindows > 0)
|
||||||
if (wp != NULL)
|
wp = lastwin; /* buffer has a window, skip it */
|
||||||
win_move_after(wp, curwin);
|
else
|
||||||
else if (split_ret == OK)
|
wp = NULL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
/* Check if this buffer already has a window */
|
||||||
|
for (wp = firstwin; wp != NULL; wp = wp->w_next)
|
||||||
|
if (wp->w_buffer == buf)
|
||||||
|
break;
|
||||||
|
/* If the buffer already has a window, move it */
|
||||||
|
if (wp != NULL)
|
||||||
|
win_move_after(wp, curwin);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (wp == NULL && split_ret == OK)
|
||||||
{
|
{
|
||||||
/* Split the window and put the buffer in it */
|
/* Split the window and put the buffer in it */
|
||||||
p_ea_save = p_ea;
|
p_ea_save = p_ea;
|
||||||
|
199
src/spell.c
199
src/spell.c
@@ -904,8 +904,8 @@ static int spell_edit_score_limit __ARGS((slang_T *slang, char_u *badword, char_
|
|||||||
#ifdef FEAT_MBYTE
|
#ifdef FEAT_MBYTE
|
||||||
static int spell_edit_score_limit_w __ARGS((slang_T *slang, char_u *badword, char_u *goodword, int limit));
|
static int spell_edit_score_limit_w __ARGS((slang_T *slang, char_u *badword, char_u *goodword, int limit));
|
||||||
#endif
|
#endif
|
||||||
static void dump_word __ARGS((slang_T *slang, char_u *word, int round, int flags, linenr_T lnum));
|
static void dump_word __ARGS((slang_T *slang, char_u *word, char_u *pat, int *dir, int round, int flags, linenr_T lnum));
|
||||||
static linenr_T dump_prefixes __ARGS((slang_T *slang, char_u *word, int round, int flags, linenr_T startlnum));
|
static linenr_T dump_prefixes __ARGS((slang_T *slang, char_u *word, char_u *pat, int *dir, int round, int flags, linenr_T startlnum));
|
||||||
static buf_T *open_spellbuf __ARGS((void));
|
static buf_T *open_spellbuf __ARGS((void));
|
||||||
static void close_spellbuf __ARGS((buf_T *buf));
|
static void close_spellbuf __ARGS((buf_T *buf));
|
||||||
|
|
||||||
@@ -14808,16 +14808,48 @@ pop:
|
|||||||
|
|
||||||
#define DUMPFLAG_KEEPCASE 1 /* round 2: keep-case tree */
|
#define DUMPFLAG_KEEPCASE 1 /* round 2: keep-case tree */
|
||||||
#define DUMPFLAG_COUNT 2 /* include word count */
|
#define DUMPFLAG_COUNT 2 /* include word count */
|
||||||
|
#define DUMPFLAG_ICASE 4 /* ignore case when finding matches */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ":spelldump"
|
* ":spelldump"
|
||||||
*/
|
*/
|
||||||
/*ARGSUSED*/
|
|
||||||
void
|
void
|
||||||
ex_spelldump(eap)
|
ex_spelldump(eap)
|
||||||
exarg_T *eap;
|
exarg_T *eap;
|
||||||
{
|
{
|
||||||
buf_T *buf = curbuf;
|
buf_T *buf = curbuf;
|
||||||
|
|
||||||
|
if (no_spell_checking(curwin))
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* Create a new empty buffer by splitting the window. */
|
||||||
|
do_cmdline_cmd((char_u *)"new");
|
||||||
|
if (!bufempty() || !buf_valid(buf))
|
||||||
|
return;
|
||||||
|
|
||||||
|
spell_dump_compl(buf, NULL, 0, NULL, eap->forceit ? DUMPFLAG_COUNT : 0);
|
||||||
|
|
||||||
|
/* Delete the empty line that we started with. */
|
||||||
|
if (curbuf->b_ml.ml_line_count > 1)
|
||||||
|
ml_delete(curbuf->b_ml.ml_line_count, FALSE);
|
||||||
|
|
||||||
|
redraw_later(NOT_VALID);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Go through all possible words and:
|
||||||
|
* 1. When "pat" is NULL: dump a list of all words in the current buffer.
|
||||||
|
* "ic" and "dir" are not used.
|
||||||
|
* 2. When "pat" is not NULL: add matching words to insert mode completion.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
spell_dump_compl(buf, pat, ic, dir, dumpflags_arg)
|
||||||
|
buf_T *buf; /* buffer with spell checking */
|
||||||
|
char_u *pat; /* leading part of the word */
|
||||||
|
int ic; /* ignore case */
|
||||||
|
int *dir; /* direction for adding matches */
|
||||||
|
int dumpflags_arg; /* DUMPFLAG_* */
|
||||||
|
{
|
||||||
langp_T *lp;
|
langp_T *lp;
|
||||||
slang_T *slang;
|
slang_T *slang;
|
||||||
idx_T arridx[MAXWLEN];
|
idx_T arridx[MAXWLEN];
|
||||||
@@ -14835,15 +14867,11 @@ ex_spelldump(eap)
|
|||||||
int do_region = TRUE; /* dump region names and numbers */
|
int do_region = TRUE; /* dump region names and numbers */
|
||||||
char_u *p;
|
char_u *p;
|
||||||
int lpi;
|
int lpi;
|
||||||
int dumpflags;
|
int dumpflags = dumpflags_arg;
|
||||||
|
int patlen;
|
||||||
|
|
||||||
if (no_spell_checking(curwin))
|
if (ic)
|
||||||
return;
|
dumpflags |= DUMPFLAG_ICASE;
|
||||||
|
|
||||||
/* Create a new empty buffer by splitting the window. */
|
|
||||||
do_cmdline_cmd((char_u *)"new");
|
|
||||||
if (!bufempty() || !buf_valid(buf))
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* Find out if we can support regions: All languages must support the same
|
/* Find out if we can support regions: All languages must support the same
|
||||||
* regions or none at all. */
|
* regions or none at all. */
|
||||||
@@ -14865,8 +14893,11 @@ ex_spelldump(eap)
|
|||||||
|
|
||||||
if (do_region && region_names != NULL)
|
if (do_region && region_names != NULL)
|
||||||
{
|
{
|
||||||
vim_snprintf((char *)IObuff, IOSIZE, "/regions=%s", region_names);
|
if (pat == NULL)
|
||||||
ml_append(lnum++, IObuff, (colnr_T)0, FALSE);
|
{
|
||||||
|
vim_snprintf((char *)IObuff, IOSIZE, "/regions=%s", region_names);
|
||||||
|
ml_append(lnum++, IObuff, (colnr_T)0, FALSE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
do_region = FALSE;
|
do_region = FALSE;
|
||||||
@@ -14881,8 +14912,18 @@ ex_spelldump(eap)
|
|||||||
if (slang->sl_fbyts == NULL) /* reloading failed */
|
if (slang->sl_fbyts == NULL) /* reloading failed */
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
vim_snprintf((char *)IObuff, IOSIZE, "# file: %s", slang->sl_fname);
|
if (pat == NULL)
|
||||||
ml_append(lnum++, IObuff, (colnr_T)0, FALSE);
|
{
|
||||||
|
vim_snprintf((char *)IObuff, IOSIZE, "# file: %s", slang->sl_fname);
|
||||||
|
ml_append(lnum++, IObuff, (colnr_T)0, FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* When matching with a pattern and there are no prefixes only use
|
||||||
|
* parts of the tree that match "pat". */
|
||||||
|
if (pat != NULL && slang->sl_pbyts == NULL)
|
||||||
|
patlen = STRLEN(pat);
|
||||||
|
else
|
||||||
|
patlen = 0;
|
||||||
|
|
||||||
/* round 1: case-folded tree
|
/* round 1: case-folded tree
|
||||||
* round 2: keep-case tree */
|
* round 2: keep-case tree */
|
||||||
@@ -14890,26 +14931,24 @@ ex_spelldump(eap)
|
|||||||
{
|
{
|
||||||
if (round == 1)
|
if (round == 1)
|
||||||
{
|
{
|
||||||
dumpflags = 0;
|
dumpflags &= ~DUMPFLAG_KEEPCASE;
|
||||||
byts = slang->sl_fbyts;
|
byts = slang->sl_fbyts;
|
||||||
idxs = slang->sl_fidxs;
|
idxs = slang->sl_fidxs;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dumpflags = DUMPFLAG_KEEPCASE;
|
dumpflags |= DUMPFLAG_KEEPCASE;
|
||||||
byts = slang->sl_kbyts;
|
byts = slang->sl_kbyts;
|
||||||
idxs = slang->sl_kidxs;
|
idxs = slang->sl_kidxs;
|
||||||
}
|
}
|
||||||
if (byts == NULL)
|
if (byts == NULL)
|
||||||
continue; /* array is empty */
|
continue; /* array is empty */
|
||||||
|
|
||||||
if (eap->forceit)
|
|
||||||
dumpflags |= DUMPFLAG_COUNT;
|
|
||||||
|
|
||||||
depth = 0;
|
depth = 0;
|
||||||
arridx[0] = 0;
|
arridx[0] = 0;
|
||||||
curi[0] = 1;
|
curi[0] = 1;
|
||||||
while (depth >= 0 && !got_int)
|
while (depth >= 0 && !got_int
|
||||||
|
&& (pat == NULL || !compl_interrupted))
|
||||||
{
|
{
|
||||||
if (curi[depth] > byts[arridx[depth]])
|
if (curi[depth] > byts[arridx[depth]])
|
||||||
{
|
{
|
||||||
@@ -14945,13 +14984,17 @@ ex_spelldump(eap)
|
|||||||
* when it's the first one. */
|
* when it's the first one. */
|
||||||
c = (unsigned)flags >> 24;
|
c = (unsigned)flags >> 24;
|
||||||
if (c == 0 || curi[depth] == 2)
|
if (c == 0 || curi[depth] == 2)
|
||||||
dump_word(slang, word, dumpflags,
|
{
|
||||||
flags, lnum++);
|
dump_word(slang, word, pat, dir,
|
||||||
|
dumpflags, flags, lnum);
|
||||||
|
if (pat == NULL)
|
||||||
|
++lnum;
|
||||||
|
}
|
||||||
|
|
||||||
/* Apply the prefix, if there is one. */
|
/* Apply the prefix, if there is one. */
|
||||||
if (c != 0)
|
if (c != 0)
|
||||||
lnum = dump_prefixes(slang, word, dumpflags,
|
lnum = dump_prefixes(slang, word, pat, dir,
|
||||||
flags, lnum);
|
dumpflags, flags, lnum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -14960,26 +15003,30 @@ ex_spelldump(eap)
|
|||||||
word[depth++] = c;
|
word[depth++] = c;
|
||||||
arridx[depth] = idxs[n];
|
arridx[depth] = idxs[n];
|
||||||
curi[depth] = 1;
|
curi[depth] = 1;
|
||||||
|
|
||||||
|
/* Check if this characters matches with the pattern.
|
||||||
|
* If not skip the whole tree below it.
|
||||||
|
* TODO ignorecase
|
||||||
|
* TODO: multi-byte */
|
||||||
|
if (depth <= patlen && STRNCMP(word, pat, depth) != 0)
|
||||||
|
--depth;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Delete the empty line that we started with. */
|
|
||||||
if (curbuf->b_ml.ml_line_count > 1)
|
|
||||||
ml_delete(curbuf->b_ml.ml_line_count, FALSE);
|
|
||||||
|
|
||||||
redraw_later(NOT_VALID);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Dump one word: apply case modifications and append a line to the buffer.
|
* Dump one word: apply case modifications and append a line to the buffer.
|
||||||
|
* When "lnum" is zero add insert mode completion.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
dump_word(slang, word, dumpflags, flags, lnum)
|
dump_word(slang, word, pat, dir, dumpflags, flags, lnum)
|
||||||
slang_T *slang;
|
slang_T *slang;
|
||||||
char_u *word;
|
char_u *word;
|
||||||
|
char_u *pat;
|
||||||
|
int *dir;
|
||||||
int dumpflags;
|
int dumpflags;
|
||||||
int flags;
|
int flags;
|
||||||
linenr_T lnum;
|
linenr_T lnum;
|
||||||
@@ -15007,50 +15054,66 @@ dump_word(slang, word, dumpflags, flags, lnum)
|
|||||||
}
|
}
|
||||||
tw = p;
|
tw = p;
|
||||||
|
|
||||||
/* Add flags and regions after a slash. */
|
if (pat == NULL)
|
||||||
if ((flags & (WF_BANNED | WF_RARE | WF_REGION)) || keepcap)
|
|
||||||
{
|
{
|
||||||
STRCPY(badword, p);
|
/* Add flags and regions after a slash. */
|
||||||
STRCAT(badword, "/");
|
if ((flags & (WF_BANNED | WF_RARE | WF_REGION)) || keepcap)
|
||||||
if (keepcap)
|
|
||||||
STRCAT(badword, "=");
|
|
||||||
if (flags & WF_BANNED)
|
|
||||||
STRCAT(badword, "!");
|
|
||||||
else if (flags & WF_RARE)
|
|
||||||
STRCAT(badword, "?");
|
|
||||||
if (flags & WF_REGION)
|
|
||||||
for (i = 0; i < 7; ++i)
|
|
||||||
if (flags & (0x10000 << i))
|
|
||||||
sprintf((char *)badword + STRLEN(badword), "%d", i + 1);
|
|
||||||
p = badword;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dumpflags & DUMPFLAG_COUNT)
|
|
||||||
{
|
|
||||||
hashitem_T *hi;
|
|
||||||
|
|
||||||
/* Include the word count for ":spelldump!". */
|
|
||||||
hi = hash_find(&slang->sl_wordcount, tw);
|
|
||||||
if (!HASHITEM_EMPTY(hi))
|
|
||||||
{
|
{
|
||||||
vim_snprintf((char *)IObuff, IOSIZE, "%s\t%d",
|
STRCPY(badword, p);
|
||||||
tw, HI2WC(hi)->wc_count);
|
STRCAT(badword, "/");
|
||||||
p = IObuff;
|
if (keepcap)
|
||||||
|
STRCAT(badword, "=");
|
||||||
|
if (flags & WF_BANNED)
|
||||||
|
STRCAT(badword, "!");
|
||||||
|
else if (flags & WF_RARE)
|
||||||
|
STRCAT(badword, "?");
|
||||||
|
if (flags & WF_REGION)
|
||||||
|
for (i = 0; i < 7; ++i)
|
||||||
|
if (flags & (0x10000 << i))
|
||||||
|
sprintf((char *)badword + STRLEN(badword), "%d", i + 1);
|
||||||
|
p = badword;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
ml_append(lnum, p, (colnr_T)0, FALSE);
|
if (dumpflags & DUMPFLAG_COUNT)
|
||||||
|
{
|
||||||
|
hashitem_T *hi;
|
||||||
|
|
||||||
|
/* Include the word count for ":spelldump!". */
|
||||||
|
hi = hash_find(&slang->sl_wordcount, tw);
|
||||||
|
if (!HASHITEM_EMPTY(hi))
|
||||||
|
{
|
||||||
|
vim_snprintf((char *)IObuff, IOSIZE, "%s\t%d",
|
||||||
|
tw, HI2WC(hi)->wc_count);
|
||||||
|
p = IObuff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ml_append(lnum, p, (colnr_T)0, FALSE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* TODO: ignore case, multi-byte */
|
||||||
|
if (STRNCMP(p, pat, STRLEN(pat)) == 0
|
||||||
|
&& ins_compl_add_infercase(p, (int)STRLEN(p),
|
||||||
|
dumpflags & DUMPFLAG_ICASE,
|
||||||
|
NULL, *dir, 0) == OK)
|
||||||
|
/* if dir was BACKWARD then honor it just once */
|
||||||
|
*dir = FORWARD;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* For ":spelldump": Find matching prefixes for "word". Prepend each to
|
* For ":spelldump": Find matching prefixes for "word". Prepend each to
|
||||||
* "word" and append a line to the buffer.
|
* "word" and append a line to the buffer.
|
||||||
|
* When "lnum" is zero add insert mode completion.
|
||||||
* Return the updated line number.
|
* Return the updated line number.
|
||||||
*/
|
*/
|
||||||
static linenr_T
|
static linenr_T
|
||||||
dump_prefixes(slang, word, dumpflags, flags, startlnum)
|
dump_prefixes(slang, word, pat, dir, dumpflags, flags, startlnum)
|
||||||
slang_T *slang;
|
slang_T *slang;
|
||||||
char_u *word; /* case-folded word */
|
char_u *word; /* case-folded word */
|
||||||
|
char_u *pat;
|
||||||
|
int *dir;
|
||||||
int dumpflags;
|
int dumpflags;
|
||||||
int flags; /* flags with prefix ID */
|
int flags; /* flags with prefix ID */
|
||||||
linenr_T startlnum;
|
linenr_T startlnum;
|
||||||
@@ -15117,9 +15180,11 @@ dump_prefixes(slang, word, dumpflags, flags, startlnum)
|
|||||||
if (c != 0)
|
if (c != 0)
|
||||||
{
|
{
|
||||||
vim_strncpy(prefix + depth, word, MAXWLEN - depth - 1);
|
vim_strncpy(prefix + depth, word, MAXWLEN - depth - 1);
|
||||||
dump_word(slang, prefix, dumpflags,
|
dump_word(slang, prefix, pat, dir, dumpflags,
|
||||||
(c & WF_RAREPFX) ? (flags | WF_RARE)
|
(c & WF_RAREPFX) ? (flags | WF_RARE)
|
||||||
: flags, lnum++);
|
: flags, lnum);
|
||||||
|
if (lnum != 0)
|
||||||
|
++lnum;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check for prefix that matches the word when the
|
/* Check for prefix that matches the word when the
|
||||||
@@ -15133,9 +15198,11 @@ dump_prefixes(slang, word, dumpflags, flags, startlnum)
|
|||||||
{
|
{
|
||||||
vim_strncpy(prefix + depth, word_up,
|
vim_strncpy(prefix + depth, word_up,
|
||||||
MAXWLEN - depth - 1);
|
MAXWLEN - depth - 1);
|
||||||
dump_word(slang, prefix, dumpflags,
|
dump_word(slang, prefix, pat, dir, dumpflags,
|
||||||
(c & WF_RAREPFX) ? (flags | WF_RARE)
|
(c & WF_RAREPFX) ? (flags | WF_RARE)
|
||||||
: flags, lnum++);
|
: flags, lnum);
|
||||||
|
if (lnum != 0)
|
||||||
|
++lnum;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user