updated for version 7.0026

This commit is contained in:
Bram Moolenaar
2004-12-29 20:58:21 +00:00
parent 86b6835997
commit 81695250ef
38 changed files with 1781 additions and 1282 deletions

View File

@ -1,4 +1,4 @@
*change.txt* For Vim version 7.0aa. Last change: 2004 Dec 24
*change.txt* For Vim version 7.0aa. Last change: 2004 Dec 29
VIM REFERENCE MANUAL by Bram Moolenaar
@ -985,10 +985,11 @@ Vim fills this register with text deleted with the "d", "c", "s", "x" commands
or copied with the yank "y" command, regardless of whether or not a specific
register was used (e.g. "xdd). This is like the unnamed register is pointing
to the last used register. An exception is the '_' register: "_dd does not
store the deleted text in any register. Vim uses the contents of this
register for any put command (p or P) which does not specify a register.
Additionally you can access it with the name '"'. This means you have to type
two double quotes. Writing to the "" register writes to register "0.
store the deleted text in any register.
Vim uses the contents of the unnamed register for any put command (p or P)
which does not specify a register. Additionally you can access it with the
name '"'. This means you have to type two double quotes. Writing to the ""
register writes to register "0.
{Vi: register contents are lost when changing files, no '"'}
2. Numbered registers "0 to "9 *quote_number* *quote0* *quote1*
@ -999,9 +1000,9 @@ unless the command specified another register with ["x].
Numbered register 1 contains the text deleted by the most recent delete or
change command, unless the command specified another register or the text is
less than one line (the small delete register is used then). An exception is
made for these commands: |%|, |(|, |)|, |`|, |/|, |?|, |n|, |N|, |{| and |}|.
Register "1 is always used then (this is Vi compatible). The "- register is
used as well if the delete is within a line.
made for the delete operator with these movement commands: |%|, |(|, |)|, |`|,
|/|, |?|, |n|, |N|, |{| and |}|. Register "1 is always used then (this is Vi
compatible). The "- register is used as well if the delete is within a line.
With each successive deletion or change, Vim shifts the previous contents
of register 1 into register 2, 2 into 3, and so forth, losing the previous
contents of register 9.

View File

@ -1,4 +1,4 @@
*editing.txt* For Vim version 7.0aa. Last change: 2004 Dec 16
*editing.txt* For Vim version 7.0aa. Last change: 2004 Dec 29
VIM REFERENCE MANUAL by Bram Moolenaar
@ -46,7 +46,7 @@ However, the alternate file name is not changed when |:keepalt| is used.
name. {not in Vi}
All file names are remembered in the buffer list. When you enter a file name,
for editing (e.g., with ":e filename") or writing (e.g., with (:w file name"),
for editing (e.g., with ":e filename") or writing (e.g., with ":w file name"),
the file name is added to the list. You can use the buffer list to remember
which files you edited and to quickly switch from one file to another (e.g.,
to copy text) with the |CTRL-^| command. First type the number of the file
@ -57,7 +57,7 @@ CTRL-G or *CTRL-G* *:f* *:fi* *:file*
:f[ile] Prints the current file name (as typed), the
cursor position (unless the 'ruler' option is set),
and the file status (readonly, modified, read errors,
new file)). See the 'shortmess' option about how tho
new file). See the 'shortmess' option about how tho
make this message shorter. {Vi does not include
column number}
@ -111,7 +111,7 @@ string, it is often displayed with HOME replaced with "~". This was done to
keep file names short. When reading or writing files the full name is still
used, the "~" is only used when displaying file names. When replacing the
file name would result in just "~", "~/" is used instead (to avoid confusion
with 'backupext' set to "~").
between options set to $HOME with 'backupext' set to "~").
When writing the buffer, the default is to use the current file name. Thus
when you give the "ZZ" or ":wq" command, the original file will be
@ -260,12 +260,12 @@ If you want to keep the changed buffer without saving it, switch on the
*:vi* *:visual*
:vi[sual][!] [++opt] [+cmd] [file]
When entered in Ex mode: Leave |Ex-mode|, go back to
When used in Ex mode: Leave |Ex-mode|, go back to
Normal mode. Otherwise same as |:edit|.
*:vie* *:view*
:vie[w] [++opt] [+cmd] file
When entered in Ex mode: Leave Ex mode, go back to
When used in Ex mode: Leave |Ex mode|, go back to
Normal mode. Otherwise same as |:edit|, but set
'readonly' option for this buffer. {not in Vi}
@ -666,7 +666,7 @@ list of the current window.
in Vi}
:[count]wN[ext][!] [++opt] [+cmd] [file] *:wN* *:wNext*
:[count]wp[revous][!] [++opt] [+cmd] [file] *:wp* *:wprevious*
:[count]wp[revious][!] [++opt] [+cmd] [file] *:wp* *:wprevious*
Same as :wnext, but go to previous file instead of
next. {not in Vi}
@ -1402,7 +1402,7 @@ options. There are three different types of searching:
'**' is more sophisticated:
- It ONLY matches directories.
- It matches up to 30 directories deep, so you can use it to search an
- It matches up to 30 directories deep, so you can use it to search an
entire directory tree
- The maximum number of levels matched can be given by appending a number
to '**'.

View File

@ -1,4 +1,4 @@
*fold.txt* For Vim version 7.0aa. Last change: 2004 Oct 15
*fold.txt* For Vim version 7.0aa. Last change: 2004 Dec 29
VIM REFERENCE MANUAL by Bram Moolenaar
@ -279,7 +279,7 @@ zF Create a fold for N lines. Works like "zf".
Create a fold for the lines in {range}. Works like "zf".
*zd* *E351*
zd Delete one fold at the cursor. When the cursor is on folded
zd Delete one fold at the cursor. When the cursor is on a folded
line, that fold is deleted. Nested folds are moved one level
up. In Visual mode all folds (partially) in the selected area
are deleted. Careful: This easily deletes more folds than you
@ -457,7 +457,7 @@ FOLDLEVEL *fold-foldlevel*
'foldlevel' is a number option: The higher the more folded regions are open.
When 'foldlevel' is 0, all folds are closed.
When 'foldlevel' is positive, some folds closed.
When 'foldlevel' is positive, some folds are closed.
When 'foldlevel' is very high, all folds are open.
'foldlevel' is applied when it is changed. After that manually folds can be
opened and closed.

View File

@ -1,4 +1,4 @@
*gui.txt* For Vim version 7.0aa. Last change: 2004 Jun 15
*gui.txt* For Vim version 7.0aa. Last change: 2004 Dec 29
VIM REFERENCE MANUAL by Bram Moolenaar
@ -52,7 +52,8 @@ When the GUI starts up initializations are carried out, in this order:
:let bmenu_max_pathlen = 50
- If the "-U {gvimrc}" command-line option has been used when starting Vim,
the {gvimrc} file will be read for initializations. The following
initializations are skipped.
initializations are skipped. When {gvimrc} is "NONE" no file will be read
for initializations.
- For Unix and MS-Windows, if the system gvimrc exists, it is sourced. The
name of this file is normally "$VIM/gvimrc". You can check this with
":version". Also see |$VIM|.

View File

@ -1,4 +1,4 @@
*gui_x11.txt* For Vim version 7.0aa. Last change: 2004 Jul 02
*gui_x11.txt* For Vim version 7.0aa. Last change: 2004 Dec 29
VIM REFERENCE MANUAL by Bram Moolenaar
@ -437,6 +437,9 @@ command line argument).
==============================================================================
7. KDE version *gui-kde* *kde* *KDE* *KVim*
NOTE: The KDE version is still under development. It is not recommended for
daily work.
The KDE version of Vim works with KDE 2.x and KDE 3.x.
KVim (name code for gui-kde) does not use traditional X settings for its
configuration.

View File

@ -1,4 +1,4 @@
*index.txt* For Vim version 7.0aa. Last change: 2004 Dec 24
*index.txt* For Vim version 7.0aa. Last change: 2004 Dec 29
VIM REFERENCE MANUAL by Bram Moolenaar
@ -807,6 +807,7 @@ tag command note action in Visual mode ~
------------------------------------------------------------------------------
|v_CTRL-\_CTRL-N| CTRL-\ CTRL-N stop Visual mode
|v_CTRL-\_CTRL-G| CTRL-\ CTRL-G go to mode specified with 'insertmode'
|v_CTRL-C| CTRL-C stop Visual mode
|v_CTRL-G| CTRL-G toggle between Visual mode and Select mode
|v_<BS>| <BS> 2 Select mode: delete highlighted area
|v_CTRL-H| CTRL-H 2 same as <BS>
@ -814,6 +815,7 @@ tag command note action in Visual mode ~
command
|v_CTRL-V| CTRL-V make Visual mode blockwise or stop Visual
mode
|v_<Esc>| <Esc> stop Visual mode
|v_CTRL-]| CTRL-] jump to highlighted tag
|v_!| !{filter} 2 filter the highlighted lines through the
external command {filter}

View File

@ -1,4 +1,4 @@
*map.txt* For Vim version 7.0aa. Last change: 2004 Dec 09
*map.txt* For Vim version 7.0aa. Last change: 2004 Dec 29
VIM REFERENCE MANUAL by Bram Moolenaar
@ -613,7 +613,7 @@ Examples: ({CURSOR} is where you type a non-keyword character) >
< "#i{CURSOR}" is expanded to "#include"
">#i{CURSOR}" is not expanded
>
:ab ;; <endofline>"
:ab ;; <endofline>
< "test;;" is not expanded
"test ;;" is expanded to "test <endofline>"
@ -735,7 +735,7 @@ You see: ab esc ^V^V^[
how it should appear in your .exrc file, if you choose to go that
route. The first ^V is there to quote the second ^V; the :ab
command uses ^V as its own quote character, so you can include quoted
whitespace or the | character in the abbreviation. The :ab command
whitespace or the | character in the abbreviation. The :ab command
doesn't do anything special with the ^[ character, so it doesn't need
to be quoted. (Although quoting isn't harmful; that's why typing 7
[but not 8!] ^Vs works.)
@ -750,7 +750,7 @@ Stored as: esc ^V^[
Later, when the abbreviation is expanded because the user typed in
the word "esc", the long form is subjected to the same type of
^V interpretation as keyboard input. So the ^V protects the ^[
character from being interpreted as the "exit input-mode" character.
character from being interpreted as the "exit Insert mode" character.
Instead, the ^[ is inserted into the text.
Expands to: ^[
@ -778,7 +778,7 @@ make it local to the script. But when a mapping is executed from outside of
the script, it doesn't know in which script the function was defined. To
avoid this problem, use "<SID>" instead of "s:". The same translation is done
as for mappings. This makes it possible to define a call to the function in
mapping.
a mapping.
When a local function is executed, it runs in the context of the script it was
defined in. This means that new functions and mappings it defines can also
@ -1054,7 +1054,7 @@ Examples >
Replace <line1>-pu_|<line1>,<line2>d|r <args>|<line1>d
" Count the number of lines in the range
:com! -range -nargs=0 Lines :echo <line2> - <line1> + 1 "lines"
:com! -range -nargs=0 Lines echo <line2> - <line1> + 1 "lines"
" Call a user function (example of <f-args>)
:com -nargs=* Mycmd call Myfunc(<f-args>)

View File

@ -1,4 +1,4 @@
*motion.txt* For Vim version 7.0aa. Last change: 2004 Nov 23
*motion.txt* For Vim version 7.0aa. Last change: 2004 Dec 29
VIM REFERENCE MANUAL by Bram Moolenaar
@ -831,8 +831,8 @@ was made yet in the current file.
*'^* *`^*
'^ `^ To the position where the cursor was the last time
when Insert mode was stopped This is used by the |gi|
command. Not set when the |:keepjumps| command
when Insert mode was stopped. This is used by the
|gi| command. Not set when the |:keepjumps| command
modifier was used. {not in Vi}
*'.* *`.*

View File

@ -1,4 +1,4 @@
*pi_expl.txt* For Vim version 7.0aa. Last change: 2002 Nov 08
*pi_expl.txt* For Vim version 7.0aa. Last change: 2004 Dec 29
VIM REFERENCE MANUAL by M A Aziz Ahmed
@ -65,7 +65,7 @@ splitting horizontally, use the variable: >
The default for this is the setting of splitbelow at the time the plugin is
loaded.
To control where the windows goes relative to the explorer window when
To control where the window goes relative to the explorer window when
splitting vertically, use the variable: >
let g:explSplitRight=1 " Put new window to the right of the explorer
let g:explSplitRight=0 " Put new window to the left of the explorer
@ -77,14 +77,14 @@ To use a different split method for the explorer window, use: >
" current window
let g:explStartRight=0 " Put new explorer window to the left of the
" current window
The default for this set to g:explSplitRight at the time the plugin is loaded.
The default is the value of g:explSplitRight at the time the plugin is loaded.
To use a different split method for the explorer window, use: >
let g:explStartBelow=1 " Put new explorer window below the
" current window
let g:explStartBelow=0 " Put new explorer window above the
" current window
The default for this set to g:explSplitBelow at the time the plugin is loaded.
The default is the value of g:explSplitBelow at the time the plugin is loaded.
The start splits allow for the explorer window to be placed in a file browser
type arrangement, where the directories are shown on the left and the contents

View File

@ -2520,6 +2520,10 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
:vi editing.txt /*:vi*
:vie editing.txt /*:vie*
:view editing.txt /*:view*
:vim quickfix.txt /*:vim*
:vimgrep quickfix.txt /*:vimgrep*
:vimgrepa quickfix.txt /*:vimgrepa*
:vimgrepadd quickfix.txt /*:vimgrepadd*
:visual editing.txt /*:visual*
:visual_example visual.txt /*:visual_example*
:viu various.txt /*:viu*
@ -4951,7 +4955,6 @@ 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*
@ -5601,6 +5604,7 @@ new-user-manual version6.txt /*new-user-manual*
new-utf-8 version6.txt /*new-utf-8*
new-vertsplit version6.txt /*new-vertsplit*
new-vim-server version6.txt /*new-vim-server*
new-vimgrep version7.txt /*new-vimgrep*
new-virtedit version6.txt /*new-virtedit*
news intro.txt /*news*
nextnonblank() eval.txt /*nextnonblank()*

View File

@ -1,4 +1,4 @@
*usr_40.txt* For Vim version 7.0aa. Last change: 2004 Feb 13
*usr_40.txt* For Vim version 7.0aa. Last change: 2004 Dec 29
VIM USER MANUAL - by Bram Moolenaar
@ -60,7 +60,8 @@ It looks a lot like the mapping for <F2> in Normal mode, only the start is
different. The <F2> mapping for Normal mode is still there. Thus you can map
the same key differently for each mode.
Notice that, although this mapping starts in Insert mode, it ends in Normal
mode. If you want it to continue in Insert mode, append a "a" to the mapping.
mode. If you want it to continue in Insert mode, append an "a" to the
mapping.
Here is an overview of map commands and in which mode they work:

View File

@ -1,4 +1,4 @@
*visual.txt* For Vim version 7.0aa. Last change: 2004 Jun 08
*visual.txt* For Vim version 7.0aa. Last change: 2004 Dec 29
VIM REFERENCE MANUAL by Bram Moolenaar
@ -46,7 +46,7 @@ However, when the 'selection' option is set to "exclusive" and the cursor is
after the Visual area, the character under the cursor is not included.
With "v" the text before the start position and after the end position will
not be highlighted. However, All uppercase and non-alpha operators, except
not be highlighted. However, all uppercase and non-alpha operators, except
"~" and "U", will work on whole lines anyway. See the list of operators
below.
@ -139,6 +139,9 @@ extended to the rightmost column of the longest line.
If you want to highlight exactly the same area as the last time, you can use
"gv" |gv| |v_gv|.
*v_<Esc>*
<Esc> In Visual mode: Stop Visual mode.
*v_CTRL-C*
CTRL-C In Visual mode: Stop Visual mode. When insert mode is
pending (the mode message shows
@ -176,7 +179,7 @@ When switching to another window on the same buffer, the cursor position in
that window is adjusted, so that the same Visual area is still selected. This
is especially useful to view the start of the Visual area in one window, and
the end in another. You can then use <RightMouse> (or <S-LeftMouse> when
'mousemodel' is "popup") to move either end of the Visual area.
'mousemodel' is "popup") to drag either end of the Visual area.
==============================================================================
4. Operating on the Visual area *visual-operators*
@ -362,7 +365,7 @@ Note that special characters (like '.' and '*') will cause problems.
Visual-block Examples *blockwise-examples*
With the following text, I will indicate the commands to produce the block and
the results below. In all cases, the cursor begins on the 'a' in the first
line if the test text.
line of the test text.
The following modeline settings are assumed ":ts=8:sw=4:".
It will be helpful to

View File

@ -1,4 +1,4 @@
*windows.txt* For Vim version 7.0aa. Last change: 2004 Dec 21
*windows.txt* For Vim version 7.0aa. Last change: 2004 Dec 29
VIM REFERENCE MANUAL by Bram Moolenaar
@ -877,7 +877,7 @@ list of buffers. |unlisted-buffer|
1 #h "/test/text" line 1 ~
2u "asdf" line 0 ~
3 %l+ "version.c" line 1 ~
3 %a+ "version.c" line 1 ~
When the [!] is included the list will show unlisted buffers
(the term "unlisted" is a bit confusing then...).

View File

@ -3,7 +3,7 @@
" Author: Miles Lott <milos@groupwhere.org>
" URL: http://milosch.dyndns.org/php.vim
" Last Change: 2004 May 18
" Version: 0.5
" Version: 0.4
" Notes: Close all switches with default:\nbreak; and it will look better.
" Also, open and close brackets should be alone on a line.
" This is my preference, and the only way this will look nice.
@ -11,9 +11,7 @@
" switch/case. It is nearly perfect for anyone regardless of your
" stance on brackets.
"
" Changes: 0.5 - fix duplicate indent on open tag, and empty bracketed
" statements.
" 0.4 - Fixes for closing php tag, switch statement closure, and php_indent_shortopentags
" Changes: Fixes for closing php tag, switch statement closure, and php_indent_shortopentags
" option from Steffen Bruentjen <vim@kontraphon.de>
"
" Options: php_noindent_switch=1 -- do not try to indent switch/case statements (version 0.1 behavior)
@ -51,16 +49,16 @@ function GetPhpIndent()
let pline = getline(lnum - 1) " previous to last line
let ind = indent(lnum)
" Indent after php open tag
" Indent after php open tags
if line =~ '<?php'
let ind = ind + &sw
elseif exists('g:php_indent_shortopentags')
" indent after short open tag
" indent after short open tags
endif
if exists('g:php_indent_shortopentags')
if line =~ '<?'
let ind = ind + &sw
endif
endif
" indent after php closing tag
if cline =~ '\M?>'
let ind = ind - &sw
endif
@ -74,17 +72,7 @@ function GetPhpIndent()
let ind = ind - &sw
endif
return ind
else
" Search the matching bracket (with searchpair()) and set the indent of
" to the indent of the matching line.
if cline =~ '^\s*}'
call cursor(line('.'), 1)
let ind = indent(searchpair('{', '', '}',
'bW', 'synIDattr(synID(line("."), col("."),
0), "name") =~? "string"'))
return ind
endif
" Try to indent switch/case statements as well
else " Try to indent switch/case statements as well
" Indent blocks enclosed by {} or () or case statements, with some anal requirements
if line =~ 'case.*:\|[{(]\s*\(#[^)}]*\)\=$'
let ind = ind + &sw
@ -104,7 +92,7 @@ function GetPhpIndent()
" Search the matching bracket (with searchpair()) and set the indent of cline
" to the indent of the matching line.
if cline =~ '^\s*}'
call cursor(line('. '), 1)
call cursor(line('.'), 1)
let ind = indent(searchpair('{', '', '}', 'bW', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string"'))
return ind
endif

View File

@ -1 +1 @@
source <sfile>:p:h/menu_chinese(taiwan)_taiwan.950.vim
source <sfile>:p:h/menu_chinese_taiwan.950.vim

View File

@ -1 +1 @@
source <sfile>:p:h/menu_chinese(taiwan)_taiwan.950.vim
source <sfile>:p:h/menu_chinese_taiwan.950.vim

View File

@ -1,7 +1,7 @@
" netrw.vim: Handles file transfer and remote directory listing across a network
" last change: Dec 06, 2004
" last change: Dec 29, 2004
" Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
" Version: 53
" Version: 54
" License: Vim License (see vim's :help license)
"
" But be doers of the Word, and not only hearers, deluding your own selves
@ -14,7 +14,7 @@
if exists("g:loaded_netrw") || &cp
finish
endif
let g:loaded_netrw = "v53"
let g:loaded_netrw = "v54"
let s:save_cpo = &cpo
let loaded_explorer = 1
set cpo&vim
@ -228,9 +228,9 @@ if version >= 600
au BufReadCmd file://localhost/* exe "silent doau BufReadPre ".expand("<afile>")|exe 'e /'.substitute(expand("<afile>"),"file:/*","","")|exe "silent doau BufReadPost ".expand("<afile>")
endif
au BufReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,rsync://*,sftp://* exe "silent doau BufReadPre ".expand("<afile>")|exe "Nread 0r ".expand("<afile>")|exe "silent doau BufReadPost ".expand("<afile>")
au FileReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,rsync://*,sftp://* exe "silent doau BufReadPre ".expand("<afile>")|exe "Nread " .expand("<afile>")|exe "silent doau BufReadPost ".expand("<afile>")
au FileReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,rsync://*,sftp://* exe "silent doau BufReadPre ".expand("<afile>")|exe "Nread " .expand("<afile>")|exe "silent doau FileReadPost ".expand("<afile>")
au BufWriteCmd ftp://*,rcp://*,scp://*,dav://*,rsync://*,sftp://* exe "silent doau BufWritePre ".expand("<afile>")|exe "Nwrite " .expand("<afile>")|exe "silent doau BufWritePost ".expand("<afile>")
au FileWriteCmd ftp://*,rcp://*,scp://*,dav://*,rsync://*,sftp://* exe "silent doau BufWritePre ".expand("<afile>")|exe "'[,']Nwrite " .expand("<afile>")|exe "silent doau BufWritePost ".expand("<afile>")
au FileWriteCmd ftp://*,rcp://*,scp://*,dav://*,rsync://*,sftp://* exe "silent doau BufWritePre ".expand("<afile>")|exe "'[,']Nwrite " .expand("<afile>")|exe "silent doau FileWritePost ".expand("<afile>")
augroup END
endif
@ -262,15 +262,21 @@ endfun
fun! <SID>NetRestorePosn()
" call Dfunc("NetRestorePosn() winnr=".s:netrw_winnr." line=".s:netrw_line." col=".s:netrw_col." hline=".s:netrw_hline)
" restore window
" call Decho("restore window: exe silent! ".s:netrw_winnr."wincmd w")
exe "silent! ".s:netrw_winnr."wincmd w"
if v:shell_error == 0
" as suggested by Bram M: redraw on no error
" allows protocol error messages to remain visible
redraw!
endif
" restore top-of-screen line
" call Decho("restore topofscreen: exe norm! ".s:netrw_hline."G0z")
exe "norm! ".s:netrw_hline."G0z\<CR>"
" restore position
" call Decho("restore posn: exe norm! ".s:netrw_line."G0".s:netrw_col."|")
exe "norm! ".s:netrw_line."G0".s:netrw_col."\<bar>"
" call Dret("NetRestorePosn")
@ -670,77 +676,40 @@ fun! s:NetGetFile(readcmd, fname, method)
" call Decho("(copied) fname<".fname.">")
endif
" get the file, but disable undo when reading a new buffer
if a:readcmd[0] == '0'
let use_e_cmd = 0 " 1 when using ':edit'
let delline = 0 " 1 when have to delete empty last line
if line("$") == 1 && getline(1) == ""
" Now being asked to 0r a file into an empty file.
" Safe to :e it instead, unless there is another window on the same buffer.
let curbufnr = bufnr("%")
let use_e_cmd = 1
let delline = 1
" Loop over all windows,
" reset use_e_cmd when another one is editing the current buffer.
let i = 1
while 1
if i != winnr() && winbufnr(i) == curbufnr
let use_e_cmd = 0
break
endif
let i = i + 1
if winbufnr(i) < 0
break
endif
endwhile
endif
if use_e_cmd > 0
" ':edit' the temp file, wipe out the old buffer and rename the buffer
let curfilename = expand("%")
let binlocal = &l:bin
let binglobal = &g:bin
if binlocal
setglobal bin " Need to set 'bin' globally for ":e" command.
endif
silent exe "e! ".v:cmdarg." ".fname
if binlocal && !binglobal
setglobal nobin
setlocal bin
endif
exe curbufnr . "bwipe!"
exe "f ".escape(curfilename," ")
" the ":f newname" apparently leaves the temporary file as the alternate
" file in the buffer list (see :ls!). The following command wipes it out.
exe bufnr("#")."bwipe!"
else
let oldul= &ul
setlocal ul=-1
exe a:readcmd." ".v:cmdarg." ".escape(fname," ")
if delline > 0
" wipe out last line, which should be a blank line anyway
$del
endif
let &ul= oldul
endif
" get file into buffer
" record remote filename
let rfile= bufname("%")
" call Decho("edit remotefile<".rfile.">")
" rename the current buffer to the temp file (ie. fname)
exe "keepalt file ".fname
" edit temporary file
e
" rename buffer back to remote filename
exe "keepalt file ".rfile
" wipe out the buffer with the temp file name
exe "bwipe ".fname
let line1 = 1
let line2 = line("$")
elseif filereadable(fname)
" call Decho("exe<".a:readcmd." ".v:cmdarg." ".fname.">")
" read file after current line
let curline = line(".")
let lastline= line("$")
" call Decho("exe<".a:readcmd." ".v:cmdarg." ".fname."> line#".curline)
exe a:readcmd." ".v:cmdarg." ".fname
let line1 = curline + 1
let line2 = line("$") - lastline + 1
let s:netrw_line = s:netrw_line + 1
let s:netrw_col = 1
else
" call Dret("NetGetFile")
" not readable
" call Dret("NetGetFile : fname<".fname."> not readable")
return
endif
" User-provided (ie. optional) fix-it-up command
if exists("*NetReadFixup")
let line1= line(".")
if a:readcmd == "r"
let line2= line("$") - line2 + line1
else
let line2= line("$") - line2
endif
" call Decho("calling NetReadFixup(method<".a:method."> line1=".line1." line2=".line2.")")
call NetReadFixup(a:method, line1, line2)
endif
@ -2604,7 +2573,7 @@ fun! s:NetMethod(choice) " globals: method machine id passwd fname
" call Decho("scp://...")
let b:netrw_method = 4
let g:netrw_machine= substitute(a:choice,scpurm,'\1',"")
let b:netrw_port = substitute(a:choice,scpurm,'\2',"")
let g:netrw_port = substitute(a:choice,scpurm,'\2',"")
let b:netrw_fname = substitute(a:choice,scpurm,'\3',"")
" http://user@hostname/...path-to-file
@ -2639,9 +2608,6 @@ fun! s:NetMethod(choice) " globals: method machine id passwd fname
let g:netrw_machine= substitute(a:choice,ftpurm,'\3',"")
let g:netrw_port = substitute(a:choice,ftpurm,'\4',"")
let b:netrw_fname = substitute(a:choice,ftpurm,'\5',"")
if g:netrw_port != ""
let g:netrw_port = substitute(g:netrw_port,"[#:]","","")
endif
if userid != ""
let g:netrw_uid= userid
endif
@ -2725,6 +2691,11 @@ fun! s:NetMethod(choice) " globals: method machine id passwd fname
endif
let b:netrw_method = -1
endif
" remove any leading [:#] from port number
if g:netrw_port != ""
let g:netrw_port = substitute(g:netrw_port,'[#:]\+','','')
endif
" call Decho("a:choice <".a:choice.">")
" call Decho("b:netrw_method <".b:netrw_method.">")

View File

@ -335,6 +335,8 @@ CClink = $(CC)
# automatically be used if it is found. If you have GNOME, but do not want to
# use it (e.g., want a GTK-only version), then use --enable-gui=gtk.
#
# KDE doesn't fully work, unfortunately. See the todo list.
#
# If the selected GUI isn't found, the GUI is disabled automatically
#CONF_OPT_GUI = --enable-gui=gtk
#CONF_OPT_GUI = --enable-gui=gtk --disable-gtktest

View File

@ -1641,6 +1641,8 @@ buflist_new(ffname, sfname, lnum, flags)
#endif
buf->b_u_synced = TRUE;
buf->b_flags = BF_CHECK_RO | BF_NEVERLOADED;
if (flags & BLN_DUMMY)
buf->b_flags |= BF_DUMMY;
buf_clear_file(buf);
clrallmarks(buf); /* clear marks */
fmarks_check_names(buf); /* check file marks for this file */
@ -1874,9 +1876,40 @@ buflist_getfpos()
}
}
#if defined(FEAT_QUICKFIX) || defined(FEAT_EVAL) || defined(PROTO)
/*
* Find file in buffer list by name (it has to be for the current window).
* Returns NULL if not found.
*/
buf_T *
buflist_findname_exp(fname)
char_u *fname;
{
char_u *ffname;
buf_T *buf = NULL;
/* First make the name into a full path name */
ffname = FullName_save(fname,
#ifdef UNIX
TRUE /* force expansion, get rid of symbolic links */
#else
FALSE
#endif
);
if (ffname != NULL)
{
buf = buflist_findname(ffname);
vim_free(ffname);
}
return buf;
}
#endif
/*
* Find file in buffer list by name (it has to be for the current window).
* "ffname" must have a full path.
* Skips dummy buffers.
* Returns NULL if not found.
*/
buf_T *
buflist_findname(ffname)
@ -1893,6 +1926,7 @@ buflist_findname(ffname)
/*
* Same as buflist_findname(), but pass the stat structure to avoid getting it
* twice for the same file.
* Returns NULL if not found.
*/
static buf_T *
buflist_findname_stat(ffname, stp)
@ -1903,7 +1937,7 @@ buflist_findname_stat(ffname, stp)
buf_T *buf;
for (buf = firstbuf; buf != NULL; buf = buf->b_next)
if (!otherfile_buf(buf, ffname
if ((buf->b_flags & BF_DUMMY) == 0 && !otherfile_buf(buf, ffname
#ifdef UNIX
, stp
#endif
@ -2457,9 +2491,9 @@ buflist_name_nr(fnum, fname, lnum)
setfname(buf, ffname, sfname, message)
buf_T *buf;
char_u *ffname, *sfname;
int message;
int message; /* give message when buffer already exists */
{
buf_T *obuf;
buf_T *obuf = NULL;
#ifdef UNIX
struct stat st;
#endif
@ -2489,9 +2523,12 @@ setfname(buf, ffname, sfname, message)
#ifdef UNIX
if (mch_stat((char *)ffname, &st) < 0)
st.st_dev = (dev_T)-1;
obuf = buflist_findname_stat(ffname, &st);
#endif
if (!(buf->b_flags & BF_DUMMY))
#ifdef UNIX
obuf = buflist_findname_stat(ffname, &st);
#else
obuf = buflist_findname(ffname);
obuf = buflist_findname(ffname);
#endif
if (obuf != NULL && obuf != buf)
{

View File

@ -820,8 +820,8 @@ win_linetabsize(wp, p, len)
}
/*
* return TRUE if 'c' is a normal identifier character
* letters and characters from 'isident' option.
* Return TRUE if 'c' is a normal identifier character:
* Letters and characters from the 'isident' option.
*/
int
vim_isIDc(c)

View File

@ -2153,6 +2153,10 @@ if test "x$GUITYPE:$enable_fontset" = "xGTK:yes" -a "0$gtk_major_version" -ge 2;
AC_MSG_RESULT(GTK+ 2 GUI selected; fontset has been disabled)
enable_fontset="no"
fi
if test "x$GUITYPE:$enable_fontset" = "xKDE:yes"; then
AC_MSG_RESULT(KDE GUI selected; fontset has been disabled)
enable_fontset="no"
fi
dnl There is no test for the BeOS GUI, if it's selected it's used
if test -z "$SKIP_BEOS"; then

View File

@ -2114,7 +2114,7 @@ do_one_cmd(cmdlinep, sourcing,
*/
if ((ea.cmdidx == CMD_make
|| ea.cmdidx == CMD_grep || ea.cmdidx == CMD_grepadd)
&& !grep_internal(&ea))
&& !grep_internal(ea.cmdidx))
{
char_u *new_cmdline;
char_u *program;
@ -3164,7 +3164,13 @@ set_one_cmd_context(xp, buff)
p++;
xp->xp_pattern = p;
if (argt & XFILE)
if ((argt & XFILE)
#ifdef FEAT_QUICKFIX
|| cmdidx == CMD_vimgrep
|| cmdidx == CMD_vimgrepadd
|| grep_internal(cmdidx)
#endif
)
{
int in_quote = FALSE;
char_u *bow = NULL; /* Beginning of word */
@ -4204,14 +4210,19 @@ separate_nextcmd(eap)
p = eap->arg;
#ifdef FEAT_QUICKFIX
if (eap->cmdidx == CMD_vimgrep
|| eap->cmdidx == CMD_vimgrepadd
|| grep_internal(eap))
if (*p != NUL && (eap->cmdidx == CMD_vimgrep
|| eap->cmdidx == CMD_vimgrepadd
|| grep_internal(eap->cmdidx)))
{
/* Skip over the pattern. */
p = skip_regexp(p + 1, *p, TRUE, NULL);
if (*p == *eap->arg)
++p;
if (vim_isIDc(*p))
p = skiptowhite(p);
else
{
p = skip_regexp(p + 1, *p, TRUE, NULL);
if (*p == *eap->arg)
++p;
}
}
#endif

View File

@ -2080,7 +2080,8 @@ cmdline_at_end()
}
#endif
#if (defined(FEAT_XIM) && defined(FEAT_GUI_GTK)) || defined(PROTO)
#if (defined(FEAT_XIM) && (defined(FEAT_GUI_GTK) || defined(FEAT_GUI_KDE))) \
|| defined(PROTO)
/*
* Return the virtual column number at the current cursor position.
* This is used by the IM code to obtain the start of the preedit string.

View File

@ -650,7 +650,8 @@
* +xfontset X fontset support. For outputting wide characters.
*/
#ifndef FEAT_XFONTSET
# if defined(FEAT_MBYTE) && defined(HAVE_X11) && !defined(HAVE_GTK2)
# if defined(FEAT_MBYTE) && defined(HAVE_X11) \
&& !defined(HAVE_GTK2) && !defined(FEAT_GUI_KDE)
# define FEAT_XFONTSET
# else
/* # define FEAT_XFONTSET */
@ -1172,7 +1173,7 @@
|| defined(FEAT_NETBEANS_INTG))
# define FEAT_BEVAL
# if !defined(FEAT_XFONTSET) && !defined(FEAT_GUI_GTK) \
&& !defined(FEAT_GUI_W32)
&& !defined(FEAT_GUI_KDE) && !defined(FEAT_GUI_W32)
# define FEAT_XFONTSET
# endif
#endif

View File

@ -725,6 +725,7 @@ EXTERN int* (*iconv_errno) (void);
#ifdef FEAT_XIM
# ifdef FEAT_GUI_KDE
EXTERN colnr_T preedit_start_col INIT(= MAXCOL);
EXTERN colnr_T preedit_end_col INIT(= MAXCOL);
EXTERN char *draw_feedback INIT(= NULL);
# endif
# ifdef FEAT_GUI_GTK

View File

@ -1918,7 +1918,7 @@ gui_outstr_nowrap(s, len, flags, fg, bg, back)
long_u hl_mask_todo;
guicolor_T fg_color;
guicolor_T bg_color;
#if !defined(MSWIN16_FASTTEXT) && !defined(HAVE_GTK2)
#if !defined(MSWIN16_FASTTEXT) && !defined(HAVE_GTK2) && !defined(FEAT_GUI_KDE)
GuiFont font = NOFONT;
# ifdef FEAT_XFONTSET
GuiFontset fontset = NOFONTSET;
@ -1972,7 +1972,7 @@ gui_outstr_nowrap(s, len, flags, fg, bg, back)
highlight_mask = gui.highlight_mask;
hl_mask_todo = highlight_mask;
#if !defined(MSWIN16_FASTTEXT) && !defined(HAVE_GTK2)
#if !defined(MSWIN16_FASTTEXT) && !defined(HAVE_GTK2) && !defined(FEAT_GUI_KDE)
/* Set the font */
if (aep != NULL && aep->ae_u.gui.font != NOFONT)
font = aep->ae_u.gui.font;
@ -2148,7 +2148,7 @@ gui_outstr_nowrap(s, len, flags, fg, bg, back)
/* print the string so far if it's the last character or there is
* a composing character. */
if (i + cl >= len || (comping && i > start) || dowide
# if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK) || defined (FEAT_GUI_KDE)
# if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_KDE)
|| (cn > 1
# ifdef FEAT_XFONTSET
/* No fontset: At least draw char after wide char at
@ -2173,10 +2173,14 @@ gui_outstr_nowrap(s, len, flags, fg, bg, back)
cells = 0;
if (dowide)
{
#ifndef FEAT_GUI_KDE
gui_mch_set_font(gui.wide_font);
#endif
gui_mch_draw_string(gui.row, scol - cn,
s + start, cl, draw_flags);
#ifndef FEAT_GUI_KDE
gui_mch_set_font(font);
#endif
start += cl;
}

View File

@ -206,9 +206,7 @@ pixmap_create_by_dir(char_u *name)//{{{
char_u full_pathname[MAXPATHL + 1];
if (gui_find_bitmap(name, full_pathname, "xpm") == OK)
{
return QPixmap((const char *)full_pathname);
}
else
return QPixmap();
}//}}}
@ -222,7 +220,7 @@ pixmap_create_from_file(char_u *file)
#endif
void
gui_mch_add_menu(vimmenu_T * menu, int idx)//{{{
gui_mch_add_menu(vimmenu_T *menu, int idx)//{{{
{
#ifdef FEAT_MENU
QPopupMenu *me;
@ -230,7 +228,7 @@ gui_mch_add_menu(vimmenu_T * menu, int idx)//{{{
if (menu_is_popup(menu->name))
{
menu->widget = new QPopupMenu(vmw , (const char *)menu->name);
menu->widget = new QPopupMenu(vmw , QSTR(menu->name));
QObject::connect(menu->widget, SIGNAL(activated(int)), vmw,
SLOT(menu_activated(int)));
return;
@ -242,15 +240,13 @@ gui_mch_add_menu(vimmenu_T * menu, int idx)//{{{
if (parent)
{
idx++; // for tearoffs to be first in menus
me = new QPopupMenu(parent->widget, (const char *)menu->name);
parent->widget->insertItem(QString((const char *)menu->name), me,
(int)me, idx);
me = new QPopupMenu(parent->widget, QSTR(menu->name));
parent->widget->insertItem(QSTR(menu->name), me, (int)me, idx);
}
else
{
me = new QPopupMenu(vmw->menuBar() , (const char *)menu->name);
vmw->menuBar()->insertItem(QString((const char *)menu->name), me,
(int)me, idx);
me = new QPopupMenu(vmw->menuBar(), QSTR(menu->name));
vmw->menuBar()->insertItem(QSTR(menu->name), me, (int)me, idx);
}
me->setCaption((const char *)(menu->dname));
@ -264,7 +260,7 @@ gui_mch_add_menu(vimmenu_T * menu, int idx)//{{{
void
gui_mch_add_menu_item(vimmenu_T * menu, int idx)//{{{
gui_mch_add_menu_item(vimmenu_T *menu, int idx)//{{{
{
#ifdef FEAT_MENU
vimmenu_T *parent = menu->parent;
@ -302,7 +298,7 @@ gui_mch_add_menu_item(vimmenu_T * menu, int idx)//{{{
pix,
(int)menu, // id
true,
(char *)(menu->strings[MENU_INDEX_TIP]), // tooltip or text
QSTR(menu->strings[MENU_INDEX_TIP]), // tooltip or text
idx);
menu->parent=parent;
return;
@ -315,7 +311,7 @@ gui_mch_add_menu_item(vimmenu_T * menu, int idx)//{{{
parent->widget->insertSeparator();
return;
}
parent->widget->insertItem(QString((const char *)menu->name), (int)menu, idx);
parent->widget->insertItem(QSTR(menu->name), (int)menu, idx);
#endif
}//}}}
@ -378,8 +374,8 @@ toggle_tearoffs(vimmenu_T *menu, int enable)//{{{
void
gui_mch_toggle_tearoffs(int enable)//{{{
{
vmw->have_tearoff=enable;
toggle_tearoffs(root_menu, enable);
vmw->have_tearoff=enable;
toggle_tearoffs(root_menu, enable);
}//}}}
#endif
@ -389,7 +385,7 @@ gui_mch_toggle_tearoffs(int enable)//{{{
* Destroy the machine specific menu widget.
*/
void
gui_mch_destroy_menu(vimmenu_T * menu)//{{{
gui_mch_destroy_menu(vimmenu_T *menu)//{{{
{
#ifdef FEAT_TOOLBAR
if (menu->parent && menu_is_toolbar(menu->parent->name))
@ -429,6 +425,7 @@ gui_mch_set_scrollbar_pos(scrollbar_T *sb, int x, int y, int w, int h)//{{{
{
if (!sb->w)
return;
//we add the menubar and toolbar height/width
int X = 0;
int Y = 0;
@ -480,7 +477,7 @@ gui_mch_create_scrollbar(scrollbar_T *sb, int orient)//{{{
}//}}}
void
gui_mch_destroy_scrollbar(scrollbar_T * sb)//{{{
gui_mch_destroy_scrollbar(scrollbar_T *sb)//{{{
{
sbpool->destroy(sb);
}//}}}
@ -503,11 +500,11 @@ gui_mch_destroy_scrollbar(scrollbar_T * sb)//{{{
/*ARGSUSED*/
char_u *
gui_mch_browse(int saving,//{{{
char_u * title,
char_u * dflt,
char_u * ext,
char_u * initdir,
char_u * filter)
char_u *title,
char_u *dflt,
char_u *ext,
char_u *initdir,
char_u *filter)
{
char *filt_glob;
@ -524,8 +521,8 @@ gui_mch_browse(int saving,//{{{
QString s;
if (!saving)
s = KFileDialog::getOpenFileName((char *)initdir, (char *)filt_glob,
vmw, (char *)title);
s = KFileDialog::getOpenFileName(QSTR(initdir), QSTR(filt_glob),
vmw, QSTR(title));
else
s = KFileDialog::getSaveFileName();
@ -552,7 +549,7 @@ gui_mch_dialog(int type, /* type of dialog *///{{{
char_u *title, /* title of dialog */
char_u *message, /* message text */
char_u *buttons, /* names of buttons */
int def_but, /* default button */
int def_but, /* default button */
char_u *textfield)
{
gui_mch_mousehide(FALSE);
@ -566,7 +563,7 @@ gui_mch_dialog(int type, /* type of dialog *///{{{
#if defined(FEAT_MENU) || defined(PROTO)
void
gui_mch_show_popupmenu(vimmenu_T * menu)//{{{
gui_mch_show_popupmenu(vimmenu_T *menu)//{{{
{
menu->widget->popup(QCursor::pos());
}//}}}

File diff suppressed because it is too large Load Diff

View File

@ -68,7 +68,8 @@ class QLineEdit;
class QSignalMapper;
class QPaintEvent;
enum BlinkState {
enum BlinkState
{
BLINK_NONE,
BLINK_ON,
BLINK_OFF
@ -79,12 +80,12 @@ class VimWidget : public QWidget, virtual public KVim
Q_OBJECT
public:
VimWidget( QWidget *parent=0, const char *name=0, WFlags f=0 );
virtual void paintEvent( QPaintEvent *);
VimWidget(QWidget *parent = 0, const char *name = 0, WFlags f = 0);
virtual void paintEvent(QPaintEvent *);
void draw_string(int x, int y, QString s, int len, int flags);
/** Init the blinking time */
void set_blink_time( long, long, long );
void set_blink_time(long, long, long);
void start_cursor_blinking();
void stop_cursor_blinking();
void wait(long);
@ -108,24 +109,28 @@ public:
BlinkState blink_state;
QPainter *painter;
QPopupMenu *menu;
virtual void setMicroFocusHint(int x, int y, int w, int h, bool text=TRUE, QFont *f = 0)
{
QWidget::setMicroFocusHint(x, y, w, h, text, f);
}
protected:
virtual void keyPressEvent( QKeyEvent * );
virtual void mousePressEvent( QMouseEvent *);
virtual void mouseDoubleClickEvent( QMouseEvent *);
virtual void mouseReleaseEvent( QMouseEvent *);
virtual void mouseMoveEvent( QMouseEvent *);
virtual void focusInEvent( QFocusEvent * );
virtual void focusOutEvent( QFocusEvent * );
virtual void dragEnterEvent (QDragEnterEvent *);
virtual void dropEvent (QDropEvent *);
virtual void keyPressEvent(QKeyEvent *);
virtual void mousePressEvent(QMouseEvent *);
virtual void mouseDoubleClickEvent(QMouseEvent *);
virtual void mouseReleaseEvent(QMouseEvent *);
virtual void mouseMoveEvent(QMouseEvent *);
virtual void focusInEvent(QFocusEvent *);
virtual void focusOutEvent(QFocusEvent *);
virtual void dragEnterEvent(QDragEnterEvent *);
virtual void dropEvent(QDropEvent *);
#ifdef FEAT_XIM
virtual void imStartEvent ( QIMEvent * );
virtual void imEndEvent ( QIMEvent * );
virtual void imComposeEvent ( QIMEvent * );
virtual void imStartEvent(QIMEvent *);
virtual void imEndEvent(QIMEvent *);
virtual void imComposeEvent(QIMEvent *);
#endif
#ifdef FEAT_MZSCHEME
virtual void timerEvent( QTimerEvent * );
virtual void timerEvent(QTimerEvent *);
#endif
/* cursor blinking stuff */
@ -149,24 +154,24 @@ class VimMainWindow : public KMainWindow
Q_OBJECT
public:
VimMainWindow ( const char *name = 0L, WFlags f = WDestructiveClose );
VimMainWindow(const char *name = 0L, WFlags f = WDestructiveClose);
/** called when the widget closes */
// bool close(bool alsoDelete);
VimWidget *w;
KEdFind *finddlg;
KEdReplace *repldlg;
KEdFind *finddlg;
KEdReplace *repldlg;
int have_tearoff;
QTextCodec *codec;
public slots:
void menu_activated(int dx);
void clipboard_selection_update();
void clipboard_data_update();
void slotSearch();
void slotFind();
void slotReplace();
void slotReplaceAll();
void clipboard_selection_update();
void clipboard_data_update();
void slotSearch();
void slotFind();
void slotReplace();
void slotReplaceAll();
void showAboutApplication();
void showAboutKDE();
void showBugReport();
@ -177,12 +182,12 @@ public slots:
void unlock();
protected:
virtual void wheelEvent (QWheelEvent *);
virtual void resizeEvent ( QResizeEvent *e );
virtual void wheelEvent(QWheelEvent *);
virtual void resizeEvent(QResizeEvent *e);
#if defined(FEAT_SESSION)
void saveGlobalProperties (KConfig *conf);
void readGlobalProperties (KConfig *conf);
void saveGlobalProperties(KConfig *conf);
void readGlobalProperties(KConfig *conf);
#endif
bool queryClose();
bool queryExit();
@ -194,10 +199,10 @@ class VimDialog : public QDialog
{
Q_OBJECT
public:
VimDialog (int type, /* type of dialog */
unsigned char * title, /* title of dialog */
unsigned char * message, /* message text */
unsigned char * buttons, /* names of buttons */
VimDialog(int type, /* type of dialog */
unsigned char *title, /* title of dialog */
unsigned char *message, /* message text */
unsigned char *buttons, /* names of buttons */
int def_but, /* default button */
char_u *textfield); /* input text */
private:
@ -229,7 +234,8 @@ private:
QSignalMapper mapper;
};
class KVimUtils {
class KVimUtils
{
public:
static QString convertEncodingName(QString);
#if QT_VERSION<300
@ -240,6 +246,13 @@ public:
extern VimMainWindow *vmw;
extern SBPool *sbpool;
extern QString *argServerName;
extern QString *argServerName;
#define QSTR(x) \
(has_mbyte ? \
(enc_utf8 ? \
QString::fromUtf8((const char *)x) : \
QString::fromLocal8Bit((const char *)x)) : \
QString((const char *)x))
#endif // GUI_KDE_WIDGET

File diff suppressed because it is too large Load Diff

View File

@ -4341,6 +4341,7 @@ xim_set_focus(focus)
}
}
#ifndef FEAT_GUI_KDE
/*ARGSUSED*/
void
im_set_position(row, col)
@ -4349,6 +4350,7 @@ im_set_position(row, col)
{
xim_set_preedit();
}
#endif
/*
* Set the XIM to the current cursor position.
@ -4642,7 +4644,7 @@ xim_set_status_area()
#endif
}
#if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK)
#if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_KDE)
static char e_xim[] = N_("E285: Failed to create input context");
#endif
@ -5414,7 +5416,7 @@ xim_get_status_area_height()
if (xim_input_style & (int)GDK_IM_STATUS_AREA)
return gui.char_height;
#elif defined FEAT_GUI_KDE
#warning FIXME
/* always return zero? */
#else
if (status_area_enabled)
return gui.char_height;
@ -5434,6 +5436,10 @@ im_get_status()
# ifdef FEAT_GUI_GTK
if (xim_input_style & (int)GDK_IM_PREEDIT_CALLBACKS)
return xim_can_preediting;
# endif
# ifdef FEAT_GUI_KDE
if (preedit_start_col != MAXCOL)
return TRUE;
# endif
return xim_has_focus;
}

View File

@ -1320,14 +1320,13 @@ x_error_handler(dpy, error_event)
Display *dpy;
XErrorEvent *error_event;
{
/* KDE sometimes produces X error that we want to ignore */
#if defined(FEAT_GUI_KDE)
XGetErrorText(dpy, error_event->error_code, (char *)IObuff, IOSIZE);
STRCAT(IObuff, "\nVim: Got X error but we continue...\n");
fprintf(stderr, IObuff);
#if defined(FEAT_GUI_KDE)
/* KDE sometimes produces X error that we want to ignore */
STRCAT(IObuff, _("\nVim: Got X error but we continue...\n"));
mch_errmsg((char *)IObuff);
return 0;
#else
XGetErrorText(dpy, error_event->error_code, (char *)IObuff, IOSIZE);
STRCAT(IObuff, _("\nVim: Got X error\n"));
/* We cannot print a message and continue, because no X calls are allowed

View File

@ -14,6 +14,7 @@ buf_T *buflist_new __ARGS((char_u *ffname, char_u *sfname, linenr_T lnum, int fl
void free_buf_options __ARGS((buf_T *buf, int free_p_ff));
int buflist_getfile __ARGS((int n, linenr_T lnum, int options, int forceit));
void buflist_getfpos __ARGS((void));
buf_T *buflist_findname_exp __ARGS((char_u *fname));
buf_T *buflist_findname __ARGS((char_u *ffname));
int buflist_findpat __ARGS((char_u *pattern, char_u *pattern_end, int unlisted, int diffmode));
int ExpandBufnames __ARGS((char_u *pat, int *num_file, char_u ***file, int options));
@ -24,7 +25,7 @@ pos_T *buflist_findfpos __ARGS((buf_T *buf));
linenr_T buflist_findlnum __ARGS((buf_T *buf));
void buflist_list __ARGS((exarg_T *eap));
int buflist_name_nr __ARGS((int fnum, char_u **fname, linenr_T *lnum));
int setfname __ARGS((buf_T *buf, char_u *ffname, char_u *sfname, int message));
int setfname __ARGS((buf_T *buf, char_u *ffname, char_u *sfname, int exist_msg));
void buf_set_name __ARGS((int fnum, char_u *name));
void buf_name_changed __ARGS((buf_T *buf));
buf_T *setaltfname __ARGS((char_u *ffname, char_u *sfname, linenr_T lnum));

View File

@ -18,6 +18,7 @@ int gui_mch_adjust_charsize __ARGS((void));
GuiFontset gui_mch_get_fontset __ARGS((char_u *name, int report_error, int fixed_width));
int gui_mch_init_font __ARGS((char_u *font_name, int fontset));
GuiFont gui_mch_get_font __ARGS((char_u *name, int report_error));
char_u *gui_mch_get_fontname __ARGS((GuiFont font, char_u *name));
void gui_mch_set_font __ARGS((GuiFont font));
void gui_mch_set_fontset __ARGS((GuiFontset fontset));
void gui_mch_free_font __ARGS((GuiFont font));

View File

@ -105,6 +105,9 @@ static void qf_update_buffer __ARGS((void));
static void qf_fill_buffer __ARGS((void));
#endif
static char_u *get_mef_name __ARGS((void));
static buf_T *load_dummy_buffer __ARGS((char_u *fname));
static void wipe_dummy_buffer __ARGS((buf_T *buf));
static void unload_dummy_buffer __ARGS((buf_T *buf));
/*
* Read the errorfile "efile" into memory, line by line, building the error
@ -2063,10 +2066,10 @@ buf_hide(buf)
* Return TRUE when using ":vimgrep" for ":grep".
*/
int
grep_internal(eap)
exarg_T *eap;
grep_internal(cmdidx)
cmdidx_T cmdidx;
{
return ((eap->cmdidx == CMD_grep || eap->cmdidx == CMD_grepadd)
return ((cmdidx == CMD_grep || cmdidx == CMD_grepadd)
&& STRCMP("internal",
*curbuf->b_p_gp == NUL ? p_gp : curbuf->b_p_gp) == 0);
}
@ -2083,7 +2086,7 @@ ex_make(eap)
unsigned len;
/* Redirect ":grep" to ":vimgrep" if 'grepprg' is "internal". */
if (grep_internal(eap))
if (grep_internal(eap->cmdidx))
{
ex_vimgrep(eap);
return;
@ -2249,35 +2252,50 @@ ex_cfile(eap)
ex_vimgrep(eap)
exarg_T *eap;
{
regmatch_T regmatch;
regmmatch_T regmatch;
char_u *save_cpo;
int fcount;
char_u **fnames;
char_u *s;
char_u *p;
int i;
FILE *fd;
int fi;
struct qf_line *prevp = NULL;
long lnum;
garray_T ga;
buf_T *buf;
int duplicate_name = FALSE;
int using_dummy;
int found_match;
int first_match = TRUE;
/* Make 'cpoptions' empty, the 'l' flag should not be used here. */
save_cpo = p_cpo;
p_cpo = empty_option;
/* Get the search pattern */
/* Get the search pattern: either white-separated or enclosed in // */
regmatch.regprog = NULL;
p = skip_regexp(eap->arg + 1, *eap->arg, TRUE, NULL);
if (*p != *eap->arg)
if (vim_isIDc(*eap->arg))
{
EMSG(_("E682: Invalid search pattern or delimiter"));
goto theend;
s = eap->arg;
p = skiptowhite(s);
}
*p++ = NUL;
regmatch.regprog = vim_regcomp(eap->arg + 1, RE_MAGIC);
else
{
s = eap->arg + 1;
p = skip_regexp(s, *eap->arg, TRUE, NULL);
if (*p != *eap->arg)
{
EMSG(_("E682: Invalid search pattern or delimiter"));
goto theend;
}
}
if (*p != NUL)
*p++ = NUL;
regmatch.regprog = vim_regcomp(s, RE_MAGIC);
if (regmatch.regprog == NULL)
goto theend;
regmatch.rm_ic = FALSE;
regmatch.rmm_ic = FALSE;
p = skipwhite(p);
if (*p == NUL)
@ -2312,28 +2330,37 @@ ex_vimgrep(eap)
for (fi = 0; fi < fcount && !got_int; ++fi)
{
fd = fopen((char *)fnames[fi], "r");
if (fd == NULL)
buf = buflist_findname_exp(fnames[fi]);
if (buf == NULL || buf->b_ml.ml_mfp == NULL)
{
/* Remember that a buffer with this name already exists. */
duplicate_name = (buf != NULL);
/* Load file into a buffer, so that 'fileencoding' is detected,
* autocommands applied, etc. */
buf = load_dummy_buffer(fnames[fi]);
using_dummy = TRUE;
}
else
/* Use existing, loaded buffer. */
using_dummy = FALSE;
if (buf == NULL)
smsg((char_u *)_("Cannot open file \"%s\""), fnames[fi]);
else
{
lnum = 1;
while (!vim_fgets(IObuff, IOSIZE, fd) && !got_int)
found_match = FALSE;
for (lnum = 1; lnum <= buf->b_ml.ml_line_count; ++lnum)
{
if (vim_regexec(&regmatch, IObuff, (colnr_T)0))
if (vim_regexec_multi(&regmatch, curwin, buf, lnum,
(colnr_T)0) > 0)
{
int l = STRLEN(IObuff);
/* remove trailing CR, LF, spaces, etc. */
while (l > 0 && IObuff[l - 1] <= ' ')
IObuff[--l] = NUL;
if (qf_add_entry(&prevp,
NULL, /* dir */
fnames[fi],
IObuff,
lnum,
(int)(regmatch.startp[0] - IObuff) + 1,/* col */
ml_get_buf(buf,
regmatch.startpos[0].lnum + lnum, FALSE),
regmatch.startpos[0].lnum + lnum,
regmatch.startpos[0].col + 1,
FALSE, /* virt_col */
0, /* nr */
0, /* type */
@ -2343,11 +2370,34 @@ ex_vimgrep(eap)
got_int = TRUE;
break;
}
else
found_match = TRUE;
}
++lnum;
line_breakcheck();
if (got_int)
break;
}
fclose(fd);
if (using_dummy)
{
if (duplicate_name)
/* Never keep a dummy buffer if there is another buffer
* with the same name. */
wipe_dummy_buffer(buf);
else if (!buf_hide(buf))
{
/* When not hiding the buffer and no match was found we
* don't need to remember the buffer, wipe it out. If
* there was a match and it wasn't the first one: only
* unload the buffer. */
if (!found_match)
wipe_dummy_buffer(buf);
else if (!first_match)
unload_dummy_buffer(buf);
}
}
if (found_match)
first_match = FALSE;
}
}
@ -2364,6 +2414,8 @@ ex_vimgrep(eap)
/* Jump to first match. */
if (qf_lists[qf_curlist].qf_count > 0)
qf_jump(0, 0, FALSE);
else
EMSG2(_(e_nomatch2), s);
theend:
vim_free(regmatch.regprog);
@ -2375,6 +2427,104 @@ theend:
free_string_option(save_cpo);
}
/*
* Load file "fname" into a dummy buffer and return the buffer pointer.
* Returns NULL if it fails.
* Must call unload_dummy_buffer() or wipe_dummy_buffer() later!
*/
static buf_T *
load_dummy_buffer(fname)
char_u *fname;
{
buf_T *newbuf;
int failed = TRUE;
#ifdef FEAT_AUTOCMD
aco_save_T aco;
#else
buf_T *old_curbuf = curbuf;
#endif
/* Allocate a buffer without putting it in the buffer list. */
newbuf = buflist_new(NULL, NULL, (linenr_T)1, BLN_DUMMY);
if (newbuf == NULL)
return NULL;
#ifdef FEAT_AUTOCMD
/* set curwin/curbuf to buf and save a few things */
aucmd_prepbuf(&aco, newbuf);
#else
curbuf = newbuf;
curwin->w_buffer = newbuf;
#endif
/* Need to set the filename for autocommands. */
(void)setfname(curbuf, fname, NULL, FALSE);
if (ml_open() == OK)
{
/* Create swap file now to avoid the ATTENTION message. */
check_need_swap(TRUE);
/* Remove the "dummy" flag, otherwise autocommands may not
* work. */
curbuf->b_flags &= ~BF_DUMMY;
if (readfile(fname, NULL,
(linenr_T)0, (linenr_T)0, (linenr_T)MAXLNUM,
NULL, READ_NEW | READ_DUMMY) == OK
&& !(curbuf->b_flags & BF_NEW))
{
failed = FALSE;
if (curbuf != newbuf)
{
/* Bloody autocommands changed the buffer! */
if (buf_valid(newbuf))
wipe_buffer(newbuf, FALSE);
newbuf = curbuf;
}
}
}
#ifdef FEAT_AUTOCMD
/* restore curwin/curbuf and a few other things */
aucmd_restbuf(&aco);
#else
curbuf = old_curbuf;
curwin->w_buffer = old_curbuf;
#endif
if (!buf_valid(newbuf))
return NULL;
if (failed)
{
wipe_dummy_buffer(newbuf);
return NULL;
}
return newbuf;
}
/*
* Wipe out the dummy buffer that load_dummy_buffer() created.
*/
static void
wipe_dummy_buffer(buf)
buf_T *buf;
{
if (curbuf != buf) /* safety check */
wipe_buffer(buf, FALSE);
}
/*
* Unload the dummy buffer that load_dummy_buffer() created.
*/
static void
unload_dummy_buffer(buf)
buf_T *buf;
{
if (curbuf != buf) /* safety check */
close_buffer(NULL, buf, DOBUF_UNLOAD);
}
/*
* ":[range]cbuffer [bufnr]" command.
*/
@ -2487,7 +2637,8 @@ ex_helpgrep(eap)
fnames[fi],
IObuff,
lnum,
0, /* col */
(int)(regmatch.startp[0] - IObuff)
+ 1, /* col */
FALSE, /* virt_col */
0, /* nr */
1, /* type */

View File

@ -3780,7 +3780,7 @@ win_line(wp, lnum, startrow, endrow)
&& (search_attr == 0 || char_attr != search_attr))
char_attr = extra_attr;
#if defined(FEAT_XIM) && (defined(FEAT_GUI_GTK) || defined(FEAT_GUI_KDE))
#if defined(FEAT_XIM) && defined(FEAT_GUI_GTK)
/* XIM don't send preedit_start and preedit_end, but they send
* preedit_changed and commit. Thus Vim can't set "im_is_active", use
* im_is_preediting() here. */
@ -4771,7 +4771,7 @@ status_match_len(xp, s)
#endif
)
++s;
len += ptr2cells(s++);
len += ptr2cells(s);
mb_ptr_adv(s);
}

View File

@ -36,5 +36,5 @@
#define VIM_VERSION_NODOT "vim70aa"
#define VIM_VERSION_SHORT "7.0aa"
#define VIM_VERSION_MEDIUM "7.0aa ALPHA"
#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2004 Dec 24)"
#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2004 Dec 24, compiled "
#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2004 Dec 29)"
#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2004 Dec 29, compiled "

View File

@ -604,6 +604,7 @@ extern char *(*dyn_libintl_textdomain)(const char *domainname);
#define BF_NEW 0x10 /* file didn't exist when editing started */
#define BF_NEW_W 0x20 /* Warned for BF_NEW and file created */
#define BF_READERR 0x40 /* got errors while reading the file */
#define BF_DUMMY 0x80 /* dummy buffer, only used internally */
/* Mask to check for flags that prevent normal writing */
#define BF_WRITE_MASK (BF_NOTEDITED + BF_NEW + BF_READERR)