0
0
mirror of https://github.com/vim/vim.git synced 2025-07-04 23:07:33 -04:00

updated for version 7.0018

This commit is contained in:
Bram Moolenaar 2004-10-11 10:16:09 +00:00
parent 7171abea1a
commit 7b0294cb9f
25 changed files with 718 additions and 444 deletions

View File

@ -1,4 +1,4 @@
*eval.txt* For Vim version 7.0aa. Last change: 2004 Oct 06
*eval.txt* For Vim version 7.0aa. Last change: 2004 Oct 10
VIM REFERENCE MANUAL by Bram Moolenaar
@ -670,19 +670,19 @@ v:fname_diff The name of the diff (patch) file. Only valid while
*v:folddashes* *folddashes-variable*
v:folddashes Used for 'foldtext': dashes representing foldlevel of a closed
fold.
Read-only. |fold-foldtext|
Read-only in the |sandbox|. |fold-foldtext|
*v:foldlevel* *foldlevel-variable*
v:foldlevel Used for 'foldtext': foldlevel of closed fold.
Read-only. |fold-foldtext|
Read-only in the |sandbox|. |fold-foldtext|
*v:foldend* *foldend-variable*
v:foldend Used for 'foldtext': last line of closed fold.
Read-only. |fold-foldtext|
Read-only in the |sandbox|. |fold-foldtext|
*v:foldstart* *foldstart-variable*
v:foldstart Used for 'foldtext': first line of closed fold.
Read-only. |fold-foldtext|
Read-only in the |sandbox|. |fold-foldtext|
*v:insertmode* *insertmode-variable*
v:insertmode Used for the |InsertEnter| and |InsertChange| autocommand
@ -710,9 +710,9 @@ v:lc_time The current locale setting for time messages of the runtime
command. See |multi-lang|.
*v:lnum* *lnum-variable*
v:lnum Line number for the 'foldexpr' and 'indentexpr' expressions.
Only valid while one of these expressions is being evaluated.
Read-only. |fold-expr| 'indentexpr'
v:lnum Line number for the 'foldexpr' |fold-expr| and 'indentexpr'
expressions. Only valid while one of these expressions is
being evaluated. Read-only when in the |sandbox|.
*v:prevcount* *prevcount-variable*
v:prevcount The count given for the last but one Normal mode command.
@ -812,6 +812,7 @@ argidx() Number current index in the argument list
argv( {nr}) String {nr} entry of the argument list
browse( {save}, {title}, {initdir}, {default})
String put up a file requester
browsedir( {title}, {initdir}) String put up a directory requester
bufexists( {expr}) Number TRUE if buffer {expr} exists
buflisted( {expr}) Number TRUE if buffer {expr} is listed
bufloaded( {expr}) Number TRUE if buffer {expr} is loaded
@ -987,6 +988,19 @@ browse({save}, {title}, {initdir}, {default})
{initdir} directory to start browsing in
{default} default file name
When the "Cancel" button is hit, something went wrong, or
browsing is not possible, an empty string is returned.
*browsedir()*
browsedir({title}, {initdir})
Put up a directory requester. This only works when
"has("browse")" returns non-zero (only in some GUI versions).
On systems where a directory browser is not supported a file
browser is used. In that case: select a file in the directory
to be used.
The input fields are:
{title} title for the requester
{initdir} directory to start browsing in
When the "Cancel" button is hit, something went wrong, or
browsing is not possible, an empty string is returned.
bufexists({expr}) *bufexists()*
@ -1487,6 +1501,16 @@ foldtext() Returns a String, to be displayed for a closed fold. This is
first non-blank line of the fold. Leading white space, "//"
or "/*" and the text from the 'foldmarker' and 'commentstring'
options is removed.
{not available when compiled without the |+folding| feature}
foldtextresult({lnum}) *foldtextresult()*
Returns the text that is displayed for the closed fold at line
{lnum}. Evaluates 'foldtext' in the appropriate context.
When there is no closed fold at {lnum} an empty string is
returned.
{lnum} is used like with |getline()|. Thus "." is the current
line, "'m" mark m, etc.
Useful when exporting folded text, e.g., to HTML.
{not available when compiled without the |+folding| feature}
*foreground()*
@ -4716,7 +4740,7 @@ options are evaluated in a sandbox. This means that you are protected from
these expressions having nasty side effects. This gives some safety for when
these options are set from a modeline. It is also used when the command from
a tags file is executed.
This is not guaranteed 100% secure, but it should block most attacks.
The sandbox is also used for the |:sandbox| command.
These items are not allowed in the sandbox:
- changing the buffer text
@ -4725,5 +4749,12 @@ These items are not allowed in the sandbox:
- executing a shell command
- reading or writing a file
- jumping to another buffer or editing a file
This is not guaranteed 100% secure, but it should block most attacks.
*:san* *:sandbox*
:sandbox {cmd} Execute {cmd} in the sandbox. Useful to evaluate an
option that may have been set from a modeline, e.g.
'foldexpr'.
vim:tw=78:ts=8:ft=help:norl:

View File

@ -1,4 +1,4 @@
*intro.txt* For Vim version 7.0aa. Last change: 2004 Jun 12
*intro.txt* For Vim version 7.0aa. Last change: 2004 Oct 08
VIM REFERENCE MANUAL by Bram Moolenaar
@ -226,12 +226,14 @@ Vim would never have become what it is now, without the help of these people!
Kayhan Demirel sent me news in Uganda
Chris & John Downey xvi (ideas for multi-windows version)
Henk Elbers first VMS port
Daniel Elstner GTK+ 2 port
Eric Fischer Mac port, 'cindent', and other improvements
Benji Fisher Answering lots of user questions
Bill Foster Athena GUI port
Loic Grenie xvim (ideas for multi windows version)
Sven Guckes Vim promotor and previous WWW page maintainer
Darren Hiebert Exuberant ctags
Jason Hildebrand GTK+ 2 port
Bruce Hunsaker improvements for VMS port
Andy Kahn Cscope support, GTK+ GUI port
Oezguer Kesim Maintainer of Vim Mailing Lists

View File

@ -1,4 +1,4 @@
*options.txt* For Vim version 7.0aa. Last change: 2004 Oct 07
*options.txt* For Vim version 7.0aa. Last change: 2004 Oct 08
VIM REFERENCE MANUAL by Bram Moolenaar
@ -1062,7 +1062,7 @@ A jump table for the options with a short description can be found at |Q_op|.
break if 'linebreak' is on.
*'browsedir'* *'bsdir'*
'browsedir' 'bsdir' string (default for "last")
'browsedir' 'bsdir' string (default: "last")
global
{not in Vi} {only for Motif and Win32 GUI}
Which directory to use for the file browser:

View File

@ -1,4 +1,4 @@
*syntax.txt* For Vim version 7.0aa. Last change: 2004 Sep 18
*syntax.txt* For Vim version 7.0aa. Last change: 2004 Oct 10
VIM REFERENCE MANUAL by Bram Moolenaar
@ -393,6 +393,9 @@ Force to omit the line numbers by using a zero value: >
Go back to the default to use 'number' by deleting the variable: >
:unlet html_number_lines
Closed folds are put in the HTML as they are displayed. If you don't want
this, use the "zR" command before invoking 2html.
By default, HTML optimized for old browsers is generated. If you prefer using
cascading style sheets (CSS1) for the attributes (resulting in considerably
shorter and valid HTML 4 file), use: >

View File

@ -2266,6 +2266,8 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
:sa windows.txt /*:sa*
:sal windows.txt /*:sal*
:sall windows.txt /*:sall*
:san eval.txt /*:san*
:sandbox eval.txt /*:sandbox*
:sargument windows.txt /*:sargument*
:sav editing.txt /*:sav*
:saveas editing.txt /*:saveas*
@ -4052,6 +4054,7 @@ book intro.txt /*book*
boolean options.txt /*boolean*
break-finally eval.txt /*break-finally*
browse() eval.txt /*browse()*
browsedir() eval.txt /*browsedir()*
browsefilter editing.txt /*browsefilter*
bufexists() eval.txt /*bufexists()*
buffer-hidden windows.txt /*buffer-hidden*
@ -4922,6 +4925,7 @@ hebrew hebrew.txt /*hebrew*
hebrew.txt hebrew.txt /*hebrew.txt*
help various.txt /*help*
help-context help.txt /*help-context*
help-tags tags 1
help-translated various.txt /*help-translated*
help-xterm-window various.txt /*help-xterm-window*
help.txt help.txt /*help.txt*

View File

@ -1,4 +1,4 @@
*todo.txt* For Vim version 7.0aa. Last change: 2004 Oct 07
*todo.txt* For Vim version 7.0aa. Last change: 2004 Oct 10
VIM REFERENCE MANUAL by Bram Moolenaar
@ -30,15 +30,8 @@ be worked on, but only if you sponsor Vim development. See |sponsor|.
*known-bugs*
-------------------- Known bugs and current work -----------------------
Add browsedir(): like browse() but for directories.
For GTK it already sort-of works when the default name is empty.
When ":file" sets the alternate file name and it's empty this doesn't make
sense. Could skip it, but would that break scripts that rely on the buffer to
exist?
Folding support for 2html. (Carl Osterwisch, Oct 4)
How to evaluate an expression in the sandbox?
Now diff output!
Aborting at the ATTENTION prompt causes trouble:
buffer remains active, nwindows isn't closed (fixed in buffer.c)
@ -58,13 +51,6 @@ Solved in os_mswin.c. Add to 6.3?
Patch for Win32 textdomain: NAKADAIRA Yukihiro, Sept 17.
GTK 2 error message with this sequence (Namsh Oct 7):
- start gvim with French locale
- set enc=utf-8
- :aunmenu *
- :unlet did_install_default_menus
- :source $VIMRUNTIME/menu.vim
Valencia: executable("xxd.exe") returns true while "!xxd" doesn't work.
Works fine for me. Only in specific environment?
@ -372,6 +358,8 @@ Support ":enew filename" to edit a new buffer with a name. It's like "enew |
file filename" but without setting the alternate file to a buffer without a
name. (Charles Campbell)
Add gui_mch_browsedir() for Motif, KDE and Mac OS/X.
Vi incompatibility:
9 In Ex mode, "u" undoes all changes, not just the last one. (John Cowan)

View File

@ -1,4 +1,4 @@
*usr_21.txt* For Vim version 7.0aa. Last change: 2004 Jun 16
*usr_21.txt* For Vim version 7.0aa. Last change: 2004 Oct 10
VIM USER MANUAL - by Bram Moolenaar
@ -65,7 +65,7 @@ a look at an overview:
:w !{program} execute {program} and send text to its input
:[range]!{program} filter text through {program}
Notice that the presense of a range before "!{program}" makes a big
Notice that the presence of a range before "!{program}" makes a big
difference. Without it executes the program normally, with the range a number
of text lines is filtered through the program.

View File

@ -1,4 +1,4 @@
*version7.txt* For Vim version 7.0aa. Last change: 2004 Oct 07
*version7.txt* For Vim version 7.0aa. Last change: 2004 Oct 11
VIM REFERENCE MANUAL by Bram Moolenaar
@ -48,6 +48,13 @@ Removed the old and incomplete "VimBuddy" code.
Buffers without a name report "No Name" instead of "No File". It was
confusing for buffers with a name and 'buftype' set to "nofile".
When ":file xxx" is used in a buffer without a name, the alternate file name
isn't set. This avoids creating buffers without a name that are not useful.
The "2html.vim" script now converts closed folds to HTML. This means the HTML
looks like its displayed, with the same folds open and closed. Use "zR" if no
folds should appear in the HTML. (partly by Carl Osterwisch)
==============================================================================
NEW FEATURES *new-7*
@ -124,13 +131,18 @@ Win32: The ":winpos" command now also works in the console. (Vipin Aravind)
|:delmarks| Delete marks.
|:sandbox| Command modifier: execute the argument in the sandbox.
New functions: ~
browsedir(title, init) |browsedir()| Dialog to select a directory.
byteidx(expr, nr) |byteidx()| Index of a character. (Ilya Sher)
finddir(name) |finddir()| Find a directory in 'path'.
findfile(name) |findfile()| Find a file in 'path'. (Johannes
Zellner)
foldtextresult(lnum) |foldtextresult()| The text displayed for a closed
fold at line "lnum".
getfperm(fname) |getfperm()| Get file permission string. (Nikolai
Weibull)
getftype(fname) |getftype()| Get type of file. (Nikolai Weibull)
@ -396,4 +408,11 @@ console version.
Win32 GUI: latin9 text (iso-8859-15) was not displayed correctly, because
there is no codepage for latin9. Do our own conversion from latin9 to UCS2.
When two versions of GTK+ 2 are installed it was possible to use the header
files from one and the library from the other. Use GTK_LIBDIR to put the
directory for the library early in the link flags.
With the GUI find/replace dialog a replace only worked if the pattern was
literal text. Now it works for any pattern.
vim:tw=78:ts=8:ft=help:norl:

View File

@ -1,6 +1,6 @@
" Vim syntax support file
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2004 May 31
" Last Change: 2004 Oct 10
" (modified by David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>)
" (XHTML support by Panagiotis Issaris <takis@lumumba.luc.ac.be>)
@ -238,40 +238,88 @@ else
let s:end = line("$")
endif
" Closed folds are kept in the HTML. Prepare the closed fold template text.
if has('folding')
let s:c = &fillchars[matchend(&fillchars, 'fold:')]
if s:c == ''
let s:c = '-'
endif
let s:htmlfoldtext = '+' . s:c
while strlen(s:htmlfoldtext) < &columns
let s:htmlfoldtext = s:htmlfoldtext . s:c
endwhile
unlet s:c
endif
while s:lnum <= s:end
" Get the current line
let s:line = getline(s:lnum)
let s:len = strlen(s:line)
let s:new = ""
if s:numblines
let s:new = '<span class="lnr">' . strpart(' ', 0, strlen(line("$")) - strlen(s:lnum)) . s:lnum . '</span> '
endif
if has('folding') && foldclosed(s:lnum) > -1
"
" This is the beginning of a folded block
"
if s:numblines
let s:new = strpart(' ', 0, strlen(line("$")) - strlen(s:lnum)) . s:lnum . ' '
endif
let s:line = foldtextresult(s:lnum)
" Loop over each character in the line
let s:col = 1
while s:col <= s:len
let s:startcol = s:col " The start column for processing text
let s:id = synID(s:lnum, s:col, 1)
let s:col = s:col + 1
" Speed loop (it's small - that's the trick)
" Go along till we find a change in synID
while s:col <= s:len && s:id == synID(s:lnum, s:col, 1) | let s:col = s:col + 1 | endwhile
" Output the text with the same synID, with class set to {s:id_name}
let s:id = synIDtrans(s:id)
let s:id_name = synIDattr(s:id, "name", s:whatterm)
let s:new = s:new . '<span class="' . s:id_name . '">' . substitute(substitute(substitute(substitute(substitute(strpart(s:line, s:startcol - 1, s:col - s:startcol), '&', '\&amp;', 'g'), '<', '\&lt;', 'g'), '>', '\&gt;', 'g'), '"', '\&quot;', 'g'), "\x0c", '<hr class="PAGE-BREAK">', 'g') . '</span>'
let s:new = s:new . s:line
if !exists("html_no_pre")
let s:new = s:new . strpart(s:htmlfoldtext, strlen(s:new))
endif
" Replace the reserved html characters
let s:new = substitute(substitute(substitute(substitute(substitute(s:new, '&', '\&amp;', 'g'), '<', '\&lt;', 'g'), '>', '\&gt;', 'g'), '"', '\&quot;', 'g'), "\x0c", '<hr class="PAGE-BREAK">', 'g')
let s:id_name = "Folded"
let s:id = hlID(s:id_name)
let s:new = '<span class="' . s:id_name . '">' . s:new . '</span>'
" Add the class to class list if it's not there yet
if stridx(s:idlist, "," . s:id . ",") == -1
let s:idlist = s:idlist . s:id . ","
endif
if s:col > s:len
break
" Skip to the end of the fold
let s:lnum = foldclosedend(s:lnum)
else
"
" A line that is not folded.
"
let s:len = strlen(s:line)
if s:numblines
let s:new = '<span class="lnr">' . strpart(' ', 0, strlen(line("$")) - strlen(s:lnum)) . s:lnum . '</span> '
endif
endwhile
" Loop over each character in the line
let s:col = 1
while s:col <= s:len
let s:startcol = s:col " The start column for processing text
let s:id = synID(s:lnum, s:col, 1)
let s:col = s:col + 1
" Speed loop (it's small - that's the trick)
" Go along till we find a change in synID
while s:col <= s:len && s:id == synID(s:lnum, s:col, 1) | let s:col = s:col + 1 | endwhile
" Output the text with the same synID, with class set to {s:id_name}
let s:id = synIDtrans(s:id)
let s:id_name = synIDattr(s:id, "name", s:whatterm)
let s:new = s:new . '<span class="' . s:id_name . '">' . substitute(substitute(substitute(substitute(substitute(strpart(s:line, s:startcol - 1, s:col - s:startcol), '&', '\&amp;', 'g'), '<', '\&lt;', 'g'), '>', '\&gt;', 'g'), '"', '\&quot;', 'g'), "\x0c", '<hr class="PAGE-BREAK">', 'g') . '</span>'
" Add the class to class list if it's not there yet
if stridx(s:idlist, "," . s:id . ",") == -1
let s:idlist = s:idlist . s:id . ","
endif
if s:col > s:len
break
endif
endwhile
endif
" Expand tabs
let s:pad=0

View File

@ -1,7 +1,7 @@
" Vim syntax file
" Language: Slrn score file (based on slrn 0.9.8.0)
" Maintainer: Preben 'Peppe' Guldberg <peppe-vim@wielders.org>
" Last Change: 19 May 2004
" Maintainer: Preben 'Peppe' Guldberg <peppe@wielders.org>
" Last Change: 8 Oct 2004
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
@ -48,7 +48,7 @@ syn region slrnscScoreItem contained matchgroup=Special start="^\s*\~\={::\=" en
syn keyword slrnscScore contained Score
syn match slrnscScoreIdent contained "%.*"
syn match slrnScoreLine "^\s*Score::\=\s\+=\=-\=\d\+\s*\(%.*\)\=$" skipempty nextgroup=slrnscScoreItem contains=slrnscScore,slrnscDelim,slrnscOper,slrnscNumber,slrnscScoreIdent
syn match slrnScoreLine "^\s*Score::\=\s\+=\=[-+]\=\d\+\s*\(%.*\)\=$" skipempty nextgroup=slrnscScoreItem contains=slrnscScore,slrnscDelim,slrnscOper,slrnscNumber,slrnscScoreIdent
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already

577
src/auto/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -1586,7 +1586,7 @@ dnl define an autoconf function to check for a specified version of GTK, and
dnl try to compile/link a GTK program. this gets used once for GTK 1.1.16.
dnl
dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
dnl Test for GTK, and define GTK_CFLAGS, GTK_LIBDIR and GTK_LIBS
dnl
AC_DEFUN(AM_PATH_GTK,
[
@ -1602,6 +1602,7 @@ AC_DEFUN(AM_PATH_GTK,
dnl But I guess the dependency on pkgconfig.m4 is not wanted or
dnl something like that.
GTK_CFLAGS=`$PKG_CONFIG --cflags gtk+-2.0`
GTK_LIBDIR=`$PKG_CONFIG --libs-only-L gtk+-2.0`
GTK_LIBS=`$PKG_CONFIG --libs gtk+-2.0`
gtk_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
@ -1613,6 +1614,7 @@ AC_DEFUN(AM_PATH_GTK,
elif test "X$GTK_CONFIG" != "Xno"; then
{
GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
GTK_LIBDIR=
GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
gtk_major_version=`$GTK_CONFIG $gtk_config_args --version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
@ -1854,7 +1856,8 @@ if test -z "$SKIP_GTK"; then
dnl problems (bold fonts, --remote doesn't work).
if test "X$SKIP_GTK2" != "XYES"; then
AM_PATH_GTK(2.2.0,
[GTK_LIBNAME="$GTK_LIBS"
[GUI_LIB_LOC="$GTK_LIBDIR"
GTK_LIBNAME="$GTK_LIBS"
GUI_INC_LOC="$GTK_CFLAGS"], )
if test "x$GTK_CFLAGS" != "x"; then
SKIP_ATHENA=YES

View File

@ -184,8 +184,9 @@ current_func_returned()
#include "version.h"
/* values for flags: */
#define VV_COMPAT 1 /* compatible, also used without "v:" */
#define VV_RO 2 /* read-only */
#define VV_COMPAT 1 /* compatible, also used without "v:" */
#define VV_RO 2 /* read-only */
#define VV_RO_SBX 4 /* read-only in the sandbox*/
struct vimvar
{
@ -193,7 +194,7 @@ struct vimvar
int len; /* length of name */
char_u *val; /* current value (can also be a number!) */
char type; /* VAR_NUMBER or VAR_STRING */
char flags; /* VV_COMPAT and VV_RO */
char flags; /* VV_COMPAT, VV_RO, VV_RO_SBX */
} vimvars[VV_LEN] =
{ /* The order here must match the VV_ defines in vim.h! */
{"count", sizeof("count") - 1, NULL, VAR_NUMBER, VV_COMPAT+VV_RO},
@ -207,7 +208,7 @@ struct vimvar
{"this_session", sizeof("this_session") - 1, NULL, VAR_STRING, VV_COMPAT},
{"version", sizeof("version") - 1, (char_u *)VIM_VERSION_100,
VAR_NUMBER, VV_COMPAT+VV_RO},
{"lnum", sizeof("lnum") - 1, NULL, VAR_NUMBER, VV_RO},
{"lnum", sizeof("lnum") - 1, NULL, VAR_NUMBER, VV_RO_SBX},
{"termresponse", sizeof("termresponse") - 1, NULL, VAR_STRING, VV_RO},
{"fname", sizeof("fname") - 1, NULL, VAR_STRING, VV_RO},
{"lang", sizeof("lang") - 1, NULL, VAR_STRING, VV_RO},
@ -220,10 +221,10 @@ struct vimvar
{"fname_new", sizeof("fname_new") - 1, NULL, VAR_STRING, VV_RO},
{"fname_diff", sizeof("fname_diff") - 1, NULL, VAR_STRING, VV_RO},
{"cmdarg", sizeof("cmdarg") - 1, NULL, VAR_STRING, VV_RO},
{"foldstart", sizeof("foldstart") - 1, NULL, VAR_NUMBER, VV_RO},
{"foldend", sizeof("foldend") - 1, NULL, VAR_NUMBER, VV_RO},
{"folddashes", sizeof("folddashes") - 1, NULL, VAR_STRING, VV_RO},
{"foldlevel", sizeof("foldlevel") - 1, NULL, VAR_NUMBER, VV_RO},
{"foldstart", sizeof("foldstart") - 1, NULL, VAR_NUMBER, VV_RO_SBX},
{"foldend", sizeof("foldend") - 1, NULL, VAR_NUMBER, VV_RO_SBX},
{"folddashes", sizeof("folddashes") - 1, NULL, VAR_STRING, VV_RO_SBX},
{"foldlevel", sizeof("foldlevel") - 1, NULL, VAR_NUMBER, VV_RO_SBX},
{"progname", sizeof("progname") - 1, NULL, VAR_STRING, VV_RO},
{"servername", sizeof("servername") - 1, NULL, VAR_STRING, VV_RO},
{"dying", sizeof("dying") - 1, NULL, VAR_NUMBER, VV_RO},
@ -254,6 +255,7 @@ static void f_argc __ARGS((VAR argvars, VAR retvar));
static void f_argidx __ARGS((VAR argvars, VAR retvar));
static void f_argv __ARGS((VAR argvars, VAR retvar));
static void f_browse __ARGS((VAR argvars, VAR retvar));
static void f_browsedir __ARGS((VAR argvars, VAR retvar));
static buf_T *find_buffer __ARGS((VAR avar));
static void f_bufexists __ARGS((VAR argvars, VAR retvar));
static void f_buflisted __ARGS((VAR argvars, VAR retvar));
@ -288,6 +290,7 @@ static void f_foldclosedend __ARGS((VAR argvars, VAR retvar));
static void foldclosed_both __ARGS((VAR argvars, VAR retvar, int end));
static void f_foldlevel __ARGS((VAR argvars, VAR retvar));
static void f_foldtext __ARGS((VAR argvars, VAR retvar));
static void f_foldtextresult __ARGS((VAR argvars, VAR retvar));
static void f_foreground __ARGS((VAR argvars, VAR retvar));
static void f_getbufvar __ARGS((VAR argvars, VAR retvar));
static void f_getchar __ARGS((VAR argvars, VAR retvar));
@ -2814,6 +2817,7 @@ static struct fst
{"argidx", 0, 0, f_argidx},
{"argv", 1, 1, f_argv},
{"browse", 4, 4, f_browse},
{"browsedir", 2, 2, f_browsedir},
{"bufexists", 1, 1, f_bufexists},
{"buffer_exists", 1, 1, f_bufexists}, /* obsolete */
{"buffer_name", 1, 1, f_bufname}, /* obsolete */
@ -2848,6 +2852,7 @@ static struct fst
{"foldclosedend", 1, 1, f_foldclosedend},
{"foldlevel", 1, 1, f_foldlevel},
{"foldtext", 0, 0, f_foldtext},
{"foldtextresult", 1, 1, f_foldtextresult},
{"foreground", 0, 0, f_foreground},
{"getbufvar", 2, 2, f_getbufvar},
{"getchar", 0, 1, f_getchar},
@ -3379,7 +3384,33 @@ f_browse(argvars, retvar)
defname = get_var_string_buf(&argvars[3], buf2);
retvar->var_val.var_string =
do_browse(save, title, defname, NULL, initdir, NULL, curbuf);
do_browse(save ? BROWSE_SAVE : 0,
title, defname, NULL, initdir, NULL, curbuf);
#else
retvar->var_val.var_string = NULL;
#endif
retvar->var_type = VAR_STRING;
}
/*
* "browsedir(title, initdir)" function
*/
/* ARGSUSED */
static void
f_browsedir(argvars, retvar)
VAR argvars;
VAR retvar;
{
#ifdef FEAT_BROWSE
char_u *title;
char_u *initdir;
char_u buf[NUMBUFLEN];
title = get_var_string(&argvars[0]);
initdir = get_var_string_buf(&argvars[1], buf);
retvar->var_val.var_string = do_browse(BROWSE_DIR,
title, NULL, NULL, initdir, NULL, curbuf);
#else
retvar->var_val.var_string = NULL;
#endif
@ -4398,6 +4429,39 @@ f_foldtext(argvars, retvar)
#endif
}
/*
* "foldtextresult(lnum)" function
*/
/*ARGSUSED*/
static void
f_foldtextresult(argvars, retvar)
VAR argvars;
VAR retvar;
{
#ifdef FEAT_FOLDING
linenr_T lnum;
char_u *text;
char_u buf[51];
foldinfo_T foldinfo;
int fold_count;
#endif
retvar->var_type = VAR_STRING;
retvar->var_val.var_string = NULL;
#ifdef FEAT_FOLDING
lnum = get_var_lnum(argvars);
fold_count = foldedCount(curwin, lnum, &foldinfo);
if (fold_count > 0)
{
text = get_foldtext(curwin, lnum, lnum + fold_count - 1,
&foldinfo, buf);
if (text == buf)
text = vim_strsave(text);
retvar->var_val.var_string = text;
}
#endif
}
/*
* "foreground()" function
*/
@ -9035,6 +9099,8 @@ set_var(name, varp)
{
if (vimvars[i].flags & VV_RO)
EMSG2(_(e_readonlyvar), name);
else if ((vimvars[i].flags & VV_RO_SBX) && sandbox)
EMSG2(_(e_readonlysbx), name);
else
{
if (vimvars[i].type == VAR_STRING)

View File

@ -2026,6 +2026,8 @@ ex_file(eap)
* The name of the current buffer will be changed.
* A new (unlisted) buffer entry needs to be made to hold the old file
* name, which will become the alternate file name.
* But don't set the alternate file name if the buffer didn't have a
* name.
*/
fname = curbuf->b_ffname;
sfname = curbuf->b_sfname;
@ -2039,9 +2041,12 @@ ex_file(eap)
return;
}
curbuf->b_flags |= BF_NOTEDITED;
buf = buflist_new(fname, xfname, curwin->w_cursor.lnum, 0);
if (buf != NULL && !cmdmod.keepalt)
curwin->w_alt_fnum = buf->b_fnum;
if (xfname != NULL && *xfname != NUL)
{
buf = buflist_new(fname, xfname, curwin->w_cursor.lnum, 0);
if (buf != NULL && !cmdmod.keepalt)
curwin->w_alt_fnum = buf->b_fnum;
}
vim_free(fname);
vim_free(sfname);
#ifdef FEAT_AUTOCMD
@ -2105,7 +2110,7 @@ do_write(eap)
#ifdef FEAT_BROWSE
if (cmdmod.browse)
{
browse_file = do_browse(TRUE, (char_u *)_("Save As"), ffname,
browse_file = do_browse(BROWSE_SAVE, (char_u *)_("Save As"), ffname,
NULL, NULL, NULL, curbuf);
if (browse_file == NULL)
goto theend;
@ -2609,7 +2614,7 @@ do_ecmd(fnum, ffname, sfname, eap, newlnum, flags)
#ifdef FEAT_BROWSE
if (cmdmod.browse)
{
browse_file = do_browse(FALSE, (char_u *)_("Edit File"), ffname,
browse_file = do_browse(0, (char_u *)_("Edit File"), ffname,
NULL, NULL, NULL, curbuf);
if (browse_file == NULL)
goto theend;

View File

@ -573,7 +573,7 @@ EX(CMD_ounmap, "ounmap", ex_unmap,
EX(CMD_ounmenu, "ounmenu", ex_menu,
EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
EX(CMD_print, "print", ex_print,
RANGE|WHOLEFOLD|COUNT|TRLBAR|CMDWIN),
RANGE|WHOLEFOLD|COUNT|TRLBAR|CMDWIN|SBOXOK),
EX(CMD_pclose, "pclose", ex_pclose,
BANG|TRLBAR),
EX(CMD_perl, "perl", ex_perl,
@ -674,6 +674,8 @@ EX(CMD_sargument, "sargument", ex_argument,
BANG|RANGE|NOTADR|COUNT|EXTRA|EDITCMD|ARGOPT|TRLBAR),
EX(CMD_sall, "sall", ex_all,
RANGE|NOTADR|COUNT|TRLBAR),
EX(CMD_sandbox, "sandbox", ex_wrongmodifier,
NEEDARG|EXTRA|NOTRLCOM),
EX(CMD_saveas, "saveas", ex_write,
BANG|DFLALL|FILE1|ARGOPT|CMDWIN|TRLBAR),
EX(CMD_sbuffer, "sbuffer", ex_buffer,

View File

@ -779,8 +779,8 @@ browse_save_fname(buf)
{
char_u *fname;
fname = do_browse(TRUE, (char_u *)_("Save As"), NULL, NULL, NULL,
NULL, buf);
fname = do_browse(BROWSE_SAVE, (char_u *)_("Save As"),
NULL, NULL, NULL, NULL, buf);
if (fname != NULL)
{
if (setfname(buf, fname, NULL, TRUE) == OK)
@ -2011,7 +2011,7 @@ ex_source(eap)
{
char_u *fname = NULL;
fname = do_browse(FALSE, (char_u *)_("Source Vim script"), eap->arg,
fname = do_browse(0, (char_u *)_("Source Vim script"), eap->arg,
NULL, NULL, BROWSE_FILTER_MACROS, NULL);
if (fname != NULL)
{

View File

@ -1042,6 +1042,11 @@
# define MSWIN_FR_BUFSIZE 256
#endif
#if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MOTIF) \
|| defined(MSWIN_FIND_REPLACE) || defined(FEAT_GUI_KDE)
# define FIND_REPLACE_DIALOG 1
#endif
/*
* +clientserver Remote control via the remote_send() function
* and the --remote argument

View File

@ -1903,6 +1903,93 @@ foldDelMarker(lnum, marker, markerlen)
}
}
/* get_foldtext() {{{2 */
/*
* Return the text for a closed fold at line "lnum", with last line "lnume".
* When 'foldtext' isn't set puts the result in "buf[51]". Otherwise the
* result is in allocated memory.
*/
char_u *
get_foldtext(wp, lnum, lnume, foldinfo, buf)
win_T *wp;
linenr_T lnum, lnume;
foldinfo_T *foldinfo;
char_u *buf;
{
char_u *text = NULL;
#ifdef FEAT_EVAL
if (*wp->w_p_fdt != NUL)
{
char_u dashes[51];
win_T *save_curwin;
int level;
char_u *p;
int len;
/* Set "v:foldstart" and "v:foldend". */
set_vim_var_nr(VV_FOLDSTART, lnum);
set_vim_var_nr(VV_FOLDEND, lnume);
/* Set "v:folddashes" to a string of "level" dashes. */
/* Set "v:foldlevel" to "level". */
level = foldinfo->fi_level;
if (level > 50)
level = 50;
vim_memset(dashes, '-', (size_t)level);
dashes[level] = NUL;
set_vim_var_string(VV_FOLDDASHES, dashes, -1);
set_vim_var_nr(VV_FOLDLEVEL, (long)level);
save_curwin = curwin;
curwin = wp;
curbuf = wp->w_buffer;
++emsg_off;
text = eval_to_string_safe(wp->w_p_fdt, NULL);
--emsg_off;
curwin = save_curwin;
curbuf = curwin->w_buffer;
set_vim_var_string(VV_FOLDDASHES, NULL, -1);
if (text != NULL)
{
/* Replace unprintable characters, if there are any. But
* replace a TAB with a space. */
for (p = text; *p != NUL; ++p)
{
# ifdef FEAT_MBYTE
if (has_mbyte && (len = (*mb_ptr2len_check)(p)) > 1)
{
if (!vim_isprintc((*mb_ptr2char)(p)))
break;
p += len - 1;
}
else
# endif
if (*p == TAB)
*p = ' ';
else if (ptr2cells(p) > 1)
break;
}
if (*p != NUL)
{
p = transstr(text);
vim_free(text);
text = p;
}
}
}
if (text == NULL)
#endif
{
sprintf((char *)buf, _("+--%3ld lines folded "),
(long)(lnume - lnum + 1));
text = buf;
}
return text;
}
/* foldtext_cleanup() {{{2 */
/*
* Remove 'foldmarker' and 'commentstring' from "str" (in-place).

View File

@ -1276,9 +1276,9 @@ gui_mch_browse(int saving,
char_u *initdir,
char_u *filter)
{
GtkFileSelection *fs; /* shortcut */
char_u dirbuf[MAXPATHL];
char_u *p;
GtkFileSelection *fs; /* shortcut */
char_u dirbuf[MAXPATHL];
char_u *p;
# ifdef HAVE_GTK2
title = CONVERT_TO_UTF8(title);
@ -1348,6 +1348,75 @@ gui_mch_browse(int saving,
return vim_strsave(p);
}
/*
* Put up a directory selector
* Returns the selected name in allocated memory, or NULL for Cancel.
* title title for the window
* dflt default name
* initdir initial directory, NULL for current dir
*/
/*ARGSUSED*/
char_u *
gui_mch_browsedir(
char_u *title,
char_u *initdir)
{
# if defined(GTK_FILE_CHOOSER) /* Only in GTK 2.4 and later. */
char_u dirbuf[MAXPATHL];
char_u *p;
GtkWidget *dirdlg; /* file selection dialog */
char_u *dirname = NULL;
title = CONVERT_TO_UTF8(title);
dirdlg = gtk_file_chooser_dialog_new(
(const gchar *)title,
GTK_WINDOW(gui.mainwin),
GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
NULL);
CONVERT_TO_UTF8_FREE(title);
/* if our pointer is currently hidden, then we should show it. */
gui_mch_mousehide(FALSE);
/* GTK appears to insist on an absolute path. */
if (initdir == NULL || *initdir == NUL
|| vim_FullName(initdir, dirbuf, MAXPATHL - 10, FALSE) == FAIL)
mch_dirname(dirbuf, MAXPATHL - 10);
/* Always need a trailing slash for a directory.
* Also add a dummy file name, so that we get to the directory. */
add_pathsep(dirbuf);
STRCAT(dirbuf, "@zd(*&1|");
gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dirdlg),
(const gchar *)dirbuf);
/* Run the dialog. */
if (gtk_dialog_run(GTK_DIALOG(dirdlg)) == GTK_RESPONSE_ACCEPT)
dirname = (char_u *)gtk_file_chooser_get_filename(
GTK_FILE_CHOOSER(dirdlg));
gtk_widget_destroy(dirdlg);
if (dirname == NULL)
return NULL;
/* shorten the file name if possible */
mch_dirname(dirbuf, MAXPATHL);
p = shorten_fname(dirname, dirbuf);
if (p == NULL || *p == NUL)
p = dirname;
p = vim_strsave(p);
g_free(dirname);
return p;
# else
/* For GTK 2.2 and earlier: fall back to ordinary file selector. */
return gui_mch_browse(0, title, NULL, NULL, initdir, NULL);
# endif
}
#endif /* FEAT_BROWSE */
#if (defined(FEAT_GUI_DIALOG) && !defined(HAVE_GTK2)) || defined(PROTO)
@ -3038,4 +3107,3 @@ gui_gtk_position_in_parent(
}
#endif /* !HAVE_GTK2 */

View File

@ -3734,7 +3734,7 @@ vim_findfile_init(path, filename, stopdirs, level, free_visited, need_dir,
{
int llevel;
int len;
char_u *errpt;
char *errpt;
/* save the fix part of the path */
ff_search_ctx->ffsc_fix_path = vim_strnsave(path,
@ -3758,15 +3758,15 @@ vim_findfile_init(path, filename, stopdirs, level, free_visited, need_dir,
ff_expand_buffer[len++] = *wc_part++;
ff_expand_buffer[len++] = *wc_part++;
llevel = strtol((char *)wc_part, (char **)&errpt, 10);
if (errpt != wc_part && llevel > 0 && llevel < 255)
llevel = strtol((char *)wc_part, &errpt, 10);
if ((char_u *)errpt != wc_part && llevel > 0 && llevel < 255)
ff_expand_buffer[len++] = llevel;
else if (errpt != wc_part && llevel == 0)
else if ((char_u *)errpt != wc_part && llevel == 0)
/* restrict is 0 -> remove already added '**' */
len -= 2;
else
ff_expand_buffer[len++] = FF_MAX_STAR_STAR_EXPAND;
wc_part = errpt;
wc_part = (char_u *)errpt;
if (*wc_part != PATHSEP && *wc_part != NUL)
{
EMSG2(_("E343: Invalid path: '**[number]' must be at the end of the path or be followed by '%s'."), PATHSEPSTR);

View File

@ -941,10 +941,10 @@ static struct vimoption
# ifdef FEAT_EVAL
(char_u *)VAR_WIN, PV_FDT,
{(char_u *)"foldtext()", (char_u *)NULL}
#else
# else
(char_u *)NULL, PV_NONE,
{(char_u *)NULL, (char_u *)0L}
#endif
# endif
},
#endif
{"formatoptions","fo", P_STRING|P_ALLOCED|P_VIM|P_FLAGLIST,

View File

@ -12,6 +12,7 @@ void gui_mch_set_scrollbar_pos __ARGS((scrollbar_T *sb, int x, int y, int w, int
void gui_mch_create_scrollbar __ARGS((scrollbar_T *sb, int orient));
void gui_mch_destroy_scrollbar __ARGS((scrollbar_T *sb));
char_u *gui_mch_browse __ARGS((int saving, char_u *title, char_u *dflt, char_u *ext, char_u *initdir, char_u *filter));
char_u *gui_mch_browsedir __ARGS((char_u *title, char_u *initdir));
int gui_mch_dialog __ARGS((int type, char_u *title, char_u *message, char_u *buttons, int def_but, char_u *textfield));
int gui_mch_dialog __ARGS((int type, char_u *title, char_u *message, char_u *buttons, int def_but, char_u *textfield));
void gui_mch_show_popupmenu __ARGS((vimmenu_T *menu));

View File

@ -12,6 +12,7 @@ int emsgn __ARGS((char_u *s, long n));
char_u *msg_trunc_attr __ARGS((char_u *s, int force, int attr));
char_u *msg_may_trunc __ARGS((int force, char_u *s));
void ex_messages __ARGS((exarg_T *eap));
void msg_end_prompt __ARGS((void));
void wait_return __ARGS((int redraw));
void set_keep_msg __ARGS((char_u *s));
void msg_start __ARGS((void));
@ -54,5 +55,5 @@ void display_confirm_msg __ARGS((void));
int vim_dialog_yesno __ARGS((int type, char_u *title, char_u *message, int dflt));
int vim_dialog_yesnocancel __ARGS((int type, char_u *title, char_u *message, int dflt));
int vim_dialog_yesnoallcancel __ARGS((int type, char_u *title, char_u *message, int dflt));
char_u *do_browse __ARGS((int saving, char_u *title, char_u *dflt, char_u *ext, char_u *initdir, char_u *filter, buf_T *buf));
char_u *do_browse __ARGS((int flags, char_u *title, char_u *dflt, char_u *ext, char_u *initdir, char_u *filter, buf_T *buf));
/* vim: set ft=c : */

View File

@ -2583,8 +2583,9 @@ ungetchr()
}
/*
* get and return the value of the hex string immediately after the current
* position. Return -1 for invalid, or 0-255 for valid. Position is updated:
* Get and return the value of the hex string at the current position.
* Return -1 if there is no valid hex number.
* The position is updated:
* blahblah\%x20asdf
* before-^ ^-after
* The parameter controls the maximum number of input characters. This will be

View File

@ -2020,9 +2020,8 @@ fold_line(wp, fold_count, foldinfo, lnum, row)
linenr_T lnume = lnum + fold_count - 1;
int len;
char_u *p;
char_u *text = NULL;
char_u *text;
int fdc;
int level;
int col;
int txtcol;
int off = (int)(current_ScreenLine - ScreenLines);
@ -2139,71 +2138,7 @@ fold_line(wp, fold_count, foldinfo, lnum, row)
/*
* 4. Compose the folded-line string with 'foldtext', if set.
*/
#ifdef FEAT_EVAL
if (*wp->w_p_fdt != NUL)
{
char_u dashes[51];
win_T *save_curwin;
/* Set "v:foldstart" and "v:foldend". */
set_vim_var_nr(VV_FOLDSTART, lnum);
set_vim_var_nr(VV_FOLDEND, lnume);
/* Set "v:folddashes" to a string of "level" dashes. */
/* Set "v:foldlevel" to "level". */
level = foldinfo->fi_level;
if (level > 50)
level = 50;
vim_memset(dashes, '-', (size_t)level);
dashes[level] = NUL;
set_vim_var_string(VV_FOLDDASHES, dashes, -1);
set_vim_var_nr(VV_FOLDLEVEL, (long)level);
save_curwin = curwin;
curwin = wp;
curbuf = wp->w_buffer;
++emsg_off;
text = eval_to_string_safe(wp->w_p_fdt, NULL);
--emsg_off;
curwin = save_curwin;
curbuf = curwin->w_buffer;
set_vim_var_string(VV_FOLDDASHES, NULL, -1);
if (text != NULL)
{
/* Replace unprintable characters, if there are any. But
* replace a TAB with a space. */
for (p = text; *p != NUL; ++p)
{
#ifdef FEAT_MBYTE
if (has_mbyte && (len = (*mb_ptr2len_check)(p)) > 1)
{
if (!vim_isprintc((*mb_ptr2char)(p)))
break;
p += len - 1;
}
else
#endif
if (*p == TAB)
*p = ' ';
else if (ptr2cells(p) > 1)
break;
}
if (*p != NUL)
{
p = transstr(text);
vim_free(text);
text = p;
}
}
}
if (text == NULL)
#endif
{
sprintf((char *)buf, _("+--%3ld lines folded "), fold_count);
text = buf;
}
text = get_foldtext(wp, lnum, lnume, foldinfo, buf);
txtcol = col; /* remember where text starts */