mirror of
https://github.com/vim/vim
synced 2025-07-16 09:12:00 +00:00
updated for version 7.0026
This commit is contained in:
@ -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
|
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
|
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
|
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
|
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
|
store the deleted text in any register.
|
||||||
register for any put command (p or P) which does not specify a register.
|
Vim uses the contents of the unnamed register for any put command (p or P)
|
||||||
Additionally you can access it with the name '"'. This means you have to type
|
which does not specify a register. Additionally you can access it with the
|
||||||
two double quotes. Writing to the "" register writes to register "0.
|
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 '"'}
|
{Vi: register contents are lost when changing files, no '"'}
|
||||||
|
|
||||||
2. Numbered registers "0 to "9 *quote_number* *quote0* *quote1*
|
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
|
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
|
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
|
less than one line (the small delete register is used then). An exception is
|
||||||
made for these commands: |%|, |(|, |)|, |`|, |/|, |?|, |n|, |N|, |{| and |}|.
|
made for the delete operator with these movement commands: |%|, |(|, |)|, |`|,
|
||||||
Register "1 is always used then (this is Vi compatible). The "- register is
|
|/|, |?|, |n|, |N|, |{| and |}|. Register "1 is always used then (this is Vi
|
||||||
used as well if the delete is within a line.
|
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
|
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
|
of register 1 into register 2, 2 into 3, and so forth, losing the previous
|
||||||
contents of register 9.
|
contents of register 9.
|
||||||
|
@ -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
|
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}
|
name. {not in Vi}
|
||||||
|
|
||||||
All file names are remembered in the buffer list. When you enter a file name,
|
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
|
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.,
|
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
|
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
|
:f[ile] Prints the current file name (as typed), the
|
||||||
cursor position (unless the 'ruler' option is set),
|
cursor position (unless the 'ruler' option is set),
|
||||||
and the file status (readonly, modified, read errors,
|
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
|
make this message shorter. {Vi does not include
|
||||||
column number}
|
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
|
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
|
used, the "~" is only used when displaying file names. When replacing the
|
||||||
file name would result in just "~", "~/" is used instead (to avoid confusion
|
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 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
|
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* *:visual*
|
||||||
:vi[sual][!] [++opt] [+cmd] [file]
|
: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|.
|
Normal mode. Otherwise same as |:edit|.
|
||||||
|
|
||||||
*:vie* *:view*
|
*:vie* *:view*
|
||||||
:vie[w] [++opt] [+cmd] file
|
: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
|
Normal mode. Otherwise same as |:edit|, but set
|
||||||
'readonly' option for this buffer. {not in Vi}
|
'readonly' option for this buffer. {not in Vi}
|
||||||
|
|
||||||
@ -666,7 +666,7 @@ list of the current window.
|
|||||||
in Vi}
|
in Vi}
|
||||||
|
|
||||||
:[count]wN[ext][!] [++opt] [+cmd] [file] *:wN* *:wNext*
|
:[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
|
Same as :wnext, but go to previous file instead of
|
||||||
next. {not in Vi}
|
next. {not in Vi}
|
||||||
|
|
||||||
@ -1402,7 +1402,7 @@ options. There are three different types of searching:
|
|||||||
|
|
||||||
'**' is more sophisticated:
|
'**' is more sophisticated:
|
||||||
- It ONLY matches directories.
|
- 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
|
entire directory tree
|
||||||
- The maximum number of levels matched can be given by appending a number
|
- The maximum number of levels matched can be given by appending a number
|
||||||
to '**'.
|
to '**'.
|
||||||
|
@ -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
|
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".
|
Create a fold for the lines in {range}. Works like "zf".
|
||||||
|
|
||||||
*zd* *E351*
|
*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
|
line, that fold is deleted. Nested folds are moved one level
|
||||||
up. In Visual mode all folds (partially) in the selected area
|
up. In Visual mode all folds (partially) in the selected area
|
||||||
are deleted. Careful: This easily deletes more folds than you
|
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.
|
'foldlevel' is a number option: The higher the more folded regions are open.
|
||||||
When 'foldlevel' is 0, all folds are closed.
|
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.
|
When 'foldlevel' is very high, all folds are open.
|
||||||
'foldlevel' is applied when it is changed. After that manually folds can be
|
'foldlevel' is applied when it is changed. After that manually folds can be
|
||||||
opened and closed.
|
opened and closed.
|
||||||
|
@ -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
|
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
|
:let bmenu_max_pathlen = 50
|
||||||
- If the "-U {gvimrc}" command-line option has been used when starting Vim,
|
- If the "-U {gvimrc}" command-line option has been used when starting Vim,
|
||||||
the {gvimrc} file will be read for initializations. The following
|
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
|
- 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
|
name of this file is normally "$VIM/gvimrc". You can check this with
|
||||||
":version". Also see |$VIM|.
|
":version". Also see |$VIM|.
|
||||||
|
@ -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
|
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||||
@ -437,6 +437,9 @@ command line argument).
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
7. KDE version *gui-kde* *kde* *KDE* *KVim*
|
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.
|
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
|
KVim (name code for gui-kde) does not use traditional X settings for its
|
||||||
configuration.
|
configuration.
|
||||||
|
@ -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
|
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-N| CTRL-\ CTRL-N stop Visual mode
|
||||||
|v_CTRL-\_CTRL-G| CTRL-\ CTRL-G go to mode specified with 'insertmode'
|
|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_CTRL-G| CTRL-G toggle between Visual mode and Select mode
|
||||||
|v_<BS>| <BS> 2 Select mode: delete highlighted area
|
|v_<BS>| <BS> 2 Select mode: delete highlighted area
|
||||||
|v_CTRL-H| CTRL-H 2 same as <BS>
|
|v_CTRL-H| CTRL-H 2 same as <BS>
|
||||||
@ -814,6 +815,7 @@ tag command note action in Visual mode ~
|
|||||||
command
|
command
|
||||||
|v_CTRL-V| CTRL-V make Visual mode blockwise or stop Visual
|
|v_CTRL-V| CTRL-V make Visual mode blockwise or stop Visual
|
||||||
mode
|
mode
|
||||||
|
|v_<Esc>| <Esc> stop Visual mode
|
||||||
|v_CTRL-]| CTRL-] jump to highlighted tag
|
|v_CTRL-]| CTRL-] jump to highlighted tag
|
||||||
|v_!| !{filter} 2 filter the highlighted lines through the
|
|v_!| !{filter} 2 filter the highlighted lines through the
|
||||||
external command {filter}
|
external command {filter}
|
||||||
|
@ -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
|
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 expanded to "#include"
|
||||||
">#i{CURSOR}" is not expanded
|
">#i{CURSOR}" is not expanded
|
||||||
>
|
>
|
||||||
:ab ;; <endofline>"
|
:ab ;; <endofline>
|
||||||
< "test;;" is not expanded
|
< "test;;" is not expanded
|
||||||
"test ;;" is expanded to "test <endofline>"
|
"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
|
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
|
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
|
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
|
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
|
to be quoted. (Although quoting isn't harmful; that's why typing 7
|
||||||
[but not 8!] ^Vs works.)
|
[but not 8!] ^Vs works.)
|
||||||
@ -750,7 +750,7 @@ Stored as: esc ^V^[
|
|||||||
Later, when the abbreviation is expanded because the user typed in
|
Later, when the abbreviation is expanded because the user typed in
|
||||||
the word "esc", the long form is subjected to the same type of
|
the word "esc", the long form is subjected to the same type of
|
||||||
^V interpretation as keyboard input. So the ^V protects the ^[
|
^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.
|
Instead, the ^[ is inserted into the text.
|
||||||
|
|
||||||
Expands to: ^[
|
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
|
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
|
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
|
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
|
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
|
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
|
Replace <line1>-pu_|<line1>,<line2>d|r <args>|<line1>d
|
||||||
|
|
||||||
" Count the number of lines in the range
|
" 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>)
|
" Call a user function (example of <f-args>)
|
||||||
:com -nargs=* Mycmd call Myfunc(<f-args>)
|
:com -nargs=* Mycmd call Myfunc(<f-args>)
|
||||||
|
@ -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
|
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
|
'^ `^ To the position where the cursor was the last time
|
||||||
when Insert mode was stopped This is used by the |gi|
|
when Insert mode was stopped. This is used by the
|
||||||
command. Not set when the |:keepjumps| command
|
|gi| command. Not set when the |:keepjumps| command
|
||||||
modifier was used. {not in Vi}
|
modifier was used. {not in Vi}
|
||||||
|
|
||||||
*'.* *`.*
|
*'.* *`.*
|
||||||
|
@ -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
|
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
|
The default for this is the setting of splitbelow at the time the plugin is
|
||||||
loaded.
|
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: >
|
splitting vertically, use the variable: >
|
||||||
let g:explSplitRight=1 " Put new window to the right of the explorer
|
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
|
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
|
" current window
|
||||||
let g:explStartRight=0 " Put new explorer window to the left of the
|
let g:explStartRight=0 " Put new explorer window to the left of the
|
||||||
" current window
|
" 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: >
|
To use a different split method for the explorer window, use: >
|
||||||
let g:explStartBelow=1 " Put new explorer window below the
|
let g:explStartBelow=1 " Put new explorer window below the
|
||||||
" current window
|
" current window
|
||||||
let g:explStartBelow=0 " Put new explorer window above the
|
let g:explStartBelow=0 " Put new explorer window above the
|
||||||
" current window
|
" 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
|
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
|
type arrangement, where the directories are shown on the left and the contents
|
||||||
|
@ -2520,6 +2520,10 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
|
|||||||
:vi editing.txt /*:vi*
|
:vi editing.txt /*:vi*
|
||||||
:vie editing.txt /*:vie*
|
:vie editing.txt /*:vie*
|
||||||
:view editing.txt /*:view*
|
: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 editing.txt /*:visual*
|
||||||
:visual_example visual.txt /*:visual_example*
|
:visual_example visual.txt /*:visual_example*
|
||||||
:viu various.txt /*:viu*
|
:viu various.txt /*:viu*
|
||||||
@ -4951,7 +4955,6 @@ hebrew hebrew.txt /*hebrew*
|
|||||||
hebrew.txt hebrew.txt /*hebrew.txt*
|
hebrew.txt hebrew.txt /*hebrew.txt*
|
||||||
help various.txt /*help*
|
help various.txt /*help*
|
||||||
help-context help.txt /*help-context*
|
help-context help.txt /*help-context*
|
||||||
help-tags tags 1
|
|
||||||
help-translated various.txt /*help-translated*
|
help-translated various.txt /*help-translated*
|
||||||
help-xterm-window various.txt /*help-xterm-window*
|
help-xterm-window various.txt /*help-xterm-window*
|
||||||
help.txt help.txt /*help.txt*
|
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-utf-8 version6.txt /*new-utf-8*
|
||||||
new-vertsplit version6.txt /*new-vertsplit*
|
new-vertsplit version6.txt /*new-vertsplit*
|
||||||
new-vim-server version6.txt /*new-vim-server*
|
new-vim-server version6.txt /*new-vim-server*
|
||||||
|
new-vimgrep version7.txt /*new-vimgrep*
|
||||||
new-virtedit version6.txt /*new-virtedit*
|
new-virtedit version6.txt /*new-virtedit*
|
||||||
news intro.txt /*news*
|
news intro.txt /*news*
|
||||||
nextnonblank() eval.txt /*nextnonblank()*
|
nextnonblank() eval.txt /*nextnonblank()*
|
||||||
|
@ -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
|
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
|
different. The <F2> mapping for Normal mode is still there. Thus you can map
|
||||||
the same key differently for each mode.
|
the same key differently for each mode.
|
||||||
Notice that, although this mapping starts in Insert mode, it ends in Normal
|
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:
|
Here is an overview of map commands and in which mode they work:
|
||||||
|
|
||||||
|
@ -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
|
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.
|
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
|
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
|
"~" and "U", will work on whole lines anyway. See the list of operators
|
||||||
below.
|
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
|
If you want to highlight exactly the same area as the last time, you can use
|
||||||
"gv" |gv| |v_gv|.
|
"gv" |gv| |v_gv|.
|
||||||
|
|
||||||
|
*v_<Esc>*
|
||||||
|
<Esc> In Visual mode: Stop Visual mode.
|
||||||
|
|
||||||
*v_CTRL-C*
|
*v_CTRL-C*
|
||||||
CTRL-C In Visual mode: Stop Visual mode. When insert mode is
|
CTRL-C In Visual mode: Stop Visual mode. When insert mode is
|
||||||
pending (the mode message shows
|
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
|
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
|
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
|
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*
|
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*
|
Visual-block Examples *blockwise-examples*
|
||||||
With the following text, I will indicate the commands to produce the block and
|
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
|
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:".
|
The following modeline settings are assumed ":ts=8:sw=4:".
|
||||||
|
|
||||||
It will be helpful to
|
It will be helpful to
|
||||||
|
@ -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
|
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||||
@ -877,7 +877,7 @@ list of buffers. |unlisted-buffer|
|
|||||||
|
|
||||||
1 #h "/test/text" line 1 ~
|
1 #h "/test/text" line 1 ~
|
||||||
2u "asdf" line 0 ~
|
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
|
When the [!] is included the list will show unlisted buffers
|
||||||
(the term "unlisted" is a bit confusing then...).
|
(the term "unlisted" is a bit confusing then...).
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
" Author: Miles Lott <milos@groupwhere.org>
|
" Author: Miles Lott <milos@groupwhere.org>
|
||||||
" URL: http://milosch.dyndns.org/php.vim
|
" URL: http://milosch.dyndns.org/php.vim
|
||||||
" Last Change: 2004 May 18
|
" Last Change: 2004 May 18
|
||||||
" Version: 0.5
|
" Version: 0.4
|
||||||
" Notes: Close all switches with default:\nbreak; and it will look better.
|
" Notes: Close all switches with default:\nbreak; and it will look better.
|
||||||
" Also, open and close brackets should be alone on a line.
|
" Also, open and close brackets should be alone on a line.
|
||||||
" This is my preference, and the only way this will look nice.
|
" 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
|
" switch/case. It is nearly perfect for anyone regardless of your
|
||||||
" stance on brackets.
|
" stance on brackets.
|
||||||
"
|
"
|
||||||
" Changes: 0.5 - fix duplicate indent on open tag, and empty bracketed
|
" Changes: Fixes for closing php tag, switch statement closure, and php_indent_shortopentags
|
||||||
" statements.
|
|
||||||
" 0.4 - Fixes for closing php tag, switch statement closure, and php_indent_shortopentags
|
|
||||||
" option from Steffen Bruentjen <vim@kontraphon.de>
|
" option from Steffen Bruentjen <vim@kontraphon.de>
|
||||||
"
|
"
|
||||||
" Options: php_noindent_switch=1 -- do not try to indent switch/case statements (version 0.1 behavior)
|
" 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 pline = getline(lnum - 1) " previous to last line
|
||||||
let ind = indent(lnum)
|
let ind = indent(lnum)
|
||||||
|
|
||||||
" Indent after php open tag
|
" Indent after php open tags
|
||||||
if line =~ '<?php'
|
if line =~ '<?php'
|
||||||
let ind = ind + &sw
|
let ind = ind + &sw
|
||||||
elseif exists('g:php_indent_shortopentags')
|
" indent after short open tags
|
||||||
" indent after short open tag
|
endif
|
||||||
|
if exists('g:php_indent_shortopentags')
|
||||||
if line =~ '<?'
|
if line =~ '<?'
|
||||||
let ind = ind + &sw
|
let ind = ind + &sw
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
" indent after php closing tag
|
|
||||||
if cline =~ '\M?>'
|
if cline =~ '\M?>'
|
||||||
let ind = ind - &sw
|
let ind = ind - &sw
|
||||||
endif
|
endif
|
||||||
@ -74,17 +72,7 @@ function GetPhpIndent()
|
|||||||
let ind = ind - &sw
|
let ind = ind - &sw
|
||||||
endif
|
endif
|
||||||
return ind
|
return ind
|
||||||
else
|
else " Try to indent switch/case statements as well
|
||||||
" 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
|
|
||||||
" Indent blocks enclosed by {} or () or case statements, with some anal requirements
|
" Indent blocks enclosed by {} or () or case statements, with some anal requirements
|
||||||
if line =~ 'case.*:\|[{(]\s*\(#[^)}]*\)\=$'
|
if line =~ 'case.*:\|[{(]\s*\(#[^)}]*\)\=$'
|
||||||
let ind = ind + &sw
|
let ind = ind + &sw
|
||||||
@ -104,7 +92,7 @@ function GetPhpIndent()
|
|||||||
" Search the matching bracket (with searchpair()) and set the indent of cline
|
" Search the matching bracket (with searchpair()) and set the indent of cline
|
||||||
" to the indent of the matching line.
|
" to the indent of the matching line.
|
||||||
if cline =~ '^\s*}'
|
if cline =~ '^\s*}'
|
||||||
call cursor(line('. '), 1)
|
call cursor(line('.'), 1)
|
||||||
let ind = indent(searchpair('{', '', '}', 'bW', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string"'))
|
let ind = indent(searchpair('{', '', '}', 'bW', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string"'))
|
||||||
return ind
|
return ind
|
||||||
endif
|
endif
|
||||||
|
@ -1 +1 @@
|
|||||||
source <sfile>:p:h/menu_chinese(taiwan)_taiwan.950.vim
|
source <sfile>:p:h/menu_chinese_taiwan.950.vim
|
||||||
|
@ -1 +1 @@
|
|||||||
source <sfile>:p:h/menu_chinese(taiwan)_taiwan.950.vim
|
source <sfile>:p:h/menu_chinese_taiwan.950.vim
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
" netrw.vim: Handles file transfer and remote directory listing across a network
|
" 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>
|
" Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
|
||||||
" Version: 53
|
" Version: 54
|
||||||
" License: Vim License (see vim's :help license)
|
" License: Vim License (see vim's :help license)
|
||||||
"
|
"
|
||||||
" But be doers of the Word, and not only hearers, deluding your own selves
|
" But be doers of the Word, and not only hearers, deluding your own selves
|
||||||
@ -14,7 +14,7 @@
|
|||||||
if exists("g:loaded_netrw") || &cp
|
if exists("g:loaded_netrw") || &cp
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
let g:loaded_netrw = "v53"
|
let g:loaded_netrw = "v54"
|
||||||
let s:save_cpo = &cpo
|
let s:save_cpo = &cpo
|
||||||
let loaded_explorer = 1
|
let loaded_explorer = 1
|
||||||
set cpo&vim
|
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>")
|
au BufReadCmd file://localhost/* exe "silent doau BufReadPre ".expand("<afile>")|exe 'e /'.substitute(expand("<afile>"),"file:/*","","")|exe "silent doau BufReadPost ".expand("<afile>")
|
||||||
endif
|
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 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 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
|
augroup END
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -262,15 +262,21 @@ endfun
|
|||||||
fun! <SID>NetRestorePosn()
|
fun! <SID>NetRestorePosn()
|
||||||
" call Dfunc("NetRestorePosn() winnr=".s:netrw_winnr." line=".s:netrw_line." col=".s:netrw_col." hline=".s:netrw_hline)
|
" 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"
|
exe "silent! ".s:netrw_winnr."wincmd w"
|
||||||
if v:shell_error == 0
|
if v:shell_error == 0
|
||||||
" as suggested by Bram M: redraw on no error
|
" as suggested by Bram M: redraw on no error
|
||||||
" allows protocol error messages to remain visible
|
" allows protocol error messages to remain visible
|
||||||
redraw!
|
redraw!
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" restore top-of-screen line
|
" restore top-of-screen line
|
||||||
|
" call Decho("restore topofscreen: exe norm! ".s:netrw_hline."G0z")
|
||||||
exe "norm! ".s:netrw_hline."G0z\<CR>"
|
exe "norm! ".s:netrw_hline."G0z\<CR>"
|
||||||
|
|
||||||
" restore position
|
" 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>"
|
exe "norm! ".s:netrw_line."G0".s:netrw_col."\<bar>"
|
||||||
|
|
||||||
" call Dret("NetRestorePosn")
|
" call Dret("NetRestorePosn")
|
||||||
@ -670,77 +676,40 @@ fun! s:NetGetFile(readcmd, fname, method)
|
|||||||
" call Decho("(copied) fname<".fname.">")
|
" call Decho("(copied) fname<".fname.">")
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" get the file, but disable undo when reading a new buffer
|
|
||||||
if a:readcmd[0] == '0'
|
if a:readcmd[0] == '0'
|
||||||
let use_e_cmd = 0 " 1 when using ':edit'
|
" get file into buffer
|
||||||
let delline = 0 " 1 when have to delete empty last line
|
" record remote filename
|
||||||
if line("$") == 1 && getline(1) == ""
|
let rfile= bufname("%")
|
||||||
" Now being asked to 0r a file into an empty file.
|
" call Decho("edit remotefile<".rfile.">")
|
||||||
" Safe to :e it instead, unless there is another window on the same buffer.
|
" rename the current buffer to the temp file (ie. fname)
|
||||||
let curbufnr = bufnr("%")
|
exe "keepalt file ".fname
|
||||||
let use_e_cmd = 1
|
" edit temporary file
|
||||||
let delline = 1
|
e
|
||||||
" Loop over all windows,
|
" rename buffer back to remote filename
|
||||||
" reset use_e_cmd when another one is editing the current buffer.
|
exe "keepalt file ".rfile
|
||||||
let i = 1
|
" wipe out the buffer with the temp file name
|
||||||
while 1
|
exe "bwipe ".fname
|
||||||
if i != winnr() && winbufnr(i) == curbufnr
|
let line1 = 1
|
||||||
let use_e_cmd = 0
|
let line2 = line("$")
|
||||||
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
|
|
||||||
elseif filereadable(fname)
|
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
|
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
|
else
|
||||||
" call Dret("NetGetFile")
|
" not readable
|
||||||
|
" call Dret("NetGetFile : fname<".fname."> not readable")
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" User-provided (ie. optional) fix-it-up command
|
" User-provided (ie. optional) fix-it-up command
|
||||||
if exists("*NetReadFixup")
|
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 Decho("calling NetReadFixup(method<".a:method."> line1=".line1." line2=".line2.")")
|
||||||
call NetReadFixup(a:method, line1, line2)
|
call NetReadFixup(a:method, line1, line2)
|
||||||
endif
|
endif
|
||||||
@ -2604,7 +2573,7 @@ fun! s:NetMethod(choice) " globals: method machine id passwd fname
|
|||||||
" call Decho("scp://...")
|
" call Decho("scp://...")
|
||||||
let b:netrw_method = 4
|
let b:netrw_method = 4
|
||||||
let g:netrw_machine= substitute(a:choice,scpurm,'\1',"")
|
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',"")
|
let b:netrw_fname = substitute(a:choice,scpurm,'\3',"")
|
||||||
|
|
||||||
" http://user@hostname/...path-to-file
|
" 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_machine= substitute(a:choice,ftpurm,'\3',"")
|
||||||
let g:netrw_port = substitute(a:choice,ftpurm,'\4',"")
|
let g:netrw_port = substitute(a:choice,ftpurm,'\4',"")
|
||||||
let b:netrw_fname = substitute(a:choice,ftpurm,'\5',"")
|
let b:netrw_fname = substitute(a:choice,ftpurm,'\5',"")
|
||||||
if g:netrw_port != ""
|
|
||||||
let g:netrw_port = substitute(g:netrw_port,"[#:]","","")
|
|
||||||
endif
|
|
||||||
if userid != ""
|
if userid != ""
|
||||||
let g:netrw_uid= userid
|
let g:netrw_uid= userid
|
||||||
endif
|
endif
|
||||||
@ -2725,6 +2691,11 @@ fun! s:NetMethod(choice) " globals: method machine id passwd fname
|
|||||||
endif
|
endif
|
||||||
let b:netrw_method = -1
|
let b:netrw_method = -1
|
||||||
endif
|
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("a:choice <".a:choice.">")
|
||||||
" call Decho("b:netrw_method <".b:netrw_method.">")
|
" call Decho("b:netrw_method <".b:netrw_method.">")
|
||||||
|
@ -335,6 +335,8 @@ CClink = $(CC)
|
|||||||
# automatically be used if it is found. If you have GNOME, but do not want to
|
# 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.
|
# 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
|
# If the selected GUI isn't found, the GUI is disabled automatically
|
||||||
#CONF_OPT_GUI = --enable-gui=gtk
|
#CONF_OPT_GUI = --enable-gui=gtk
|
||||||
#CONF_OPT_GUI = --enable-gui=gtk --disable-gtktest
|
#CONF_OPT_GUI = --enable-gui=gtk --disable-gtktest
|
||||||
|
47
src/buffer.c
47
src/buffer.c
@ -1641,6 +1641,8 @@ buflist_new(ffname, sfname, lnum, flags)
|
|||||||
#endif
|
#endif
|
||||||
buf->b_u_synced = TRUE;
|
buf->b_u_synced = TRUE;
|
||||||
buf->b_flags = BF_CHECK_RO | BF_NEVERLOADED;
|
buf->b_flags = BF_CHECK_RO | BF_NEVERLOADED;
|
||||||
|
if (flags & BLN_DUMMY)
|
||||||
|
buf->b_flags |= BF_DUMMY;
|
||||||
buf_clear_file(buf);
|
buf_clear_file(buf);
|
||||||
clrallmarks(buf); /* clear marks */
|
clrallmarks(buf); /* clear marks */
|
||||||
fmarks_check_names(buf); /* check file marks for this file */
|
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).
|
* Find file in buffer list by name (it has to be for the current window).
|
||||||
* "ffname" must have a full path.
|
* "ffname" must have a full path.
|
||||||
|
* Skips dummy buffers.
|
||||||
|
* Returns NULL if not found.
|
||||||
*/
|
*/
|
||||||
buf_T *
|
buf_T *
|
||||||
buflist_findname(ffname)
|
buflist_findname(ffname)
|
||||||
@ -1893,6 +1926,7 @@ buflist_findname(ffname)
|
|||||||
/*
|
/*
|
||||||
* Same as buflist_findname(), but pass the stat structure to avoid getting it
|
* Same as buflist_findname(), but pass the stat structure to avoid getting it
|
||||||
* twice for the same file.
|
* twice for the same file.
|
||||||
|
* Returns NULL if not found.
|
||||||
*/
|
*/
|
||||||
static buf_T *
|
static buf_T *
|
||||||
buflist_findname_stat(ffname, stp)
|
buflist_findname_stat(ffname, stp)
|
||||||
@ -1903,7 +1937,7 @@ buflist_findname_stat(ffname, stp)
|
|||||||
buf_T *buf;
|
buf_T *buf;
|
||||||
|
|
||||||
for (buf = firstbuf; buf != NULL; buf = buf->b_next)
|
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
|
#ifdef UNIX
|
||||||
, stp
|
, stp
|
||||||
#endif
|
#endif
|
||||||
@ -2457,9 +2491,9 @@ buflist_name_nr(fnum, fname, lnum)
|
|||||||
setfname(buf, ffname, sfname, message)
|
setfname(buf, ffname, sfname, message)
|
||||||
buf_T *buf;
|
buf_T *buf;
|
||||||
char_u *ffname, *sfname;
|
char_u *ffname, *sfname;
|
||||||
int message;
|
int message; /* give message when buffer already exists */
|
||||||
{
|
{
|
||||||
buf_T *obuf;
|
buf_T *obuf = NULL;
|
||||||
#ifdef UNIX
|
#ifdef UNIX
|
||||||
struct stat st;
|
struct stat st;
|
||||||
#endif
|
#endif
|
||||||
@ -2489,9 +2523,12 @@ setfname(buf, ffname, sfname, message)
|
|||||||
#ifdef UNIX
|
#ifdef UNIX
|
||||||
if (mch_stat((char *)ffname, &st) < 0)
|
if (mch_stat((char *)ffname, &st) < 0)
|
||||||
st.st_dev = (dev_T)-1;
|
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
|
#else
|
||||||
obuf = buflist_findname(ffname);
|
obuf = buflist_findname(ffname);
|
||||||
#endif
|
#endif
|
||||||
if (obuf != NULL && obuf != buf)
|
if (obuf != NULL && obuf != buf)
|
||||||
{
|
{
|
||||||
|
@ -820,8 +820,8 @@ win_linetabsize(wp, p, len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* return TRUE if 'c' is a normal identifier character
|
* Return TRUE if 'c' is a normal identifier character:
|
||||||
* letters and characters from 'isident' option.
|
* Letters and characters from the 'isident' option.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
vim_isIDc(c)
|
vim_isIDc(c)
|
||||||
|
@ -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)
|
AC_MSG_RESULT(GTK+ 2 GUI selected; fontset has been disabled)
|
||||||
enable_fontset="no"
|
enable_fontset="no"
|
||||||
fi
|
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
|
dnl There is no test for the BeOS GUI, if it's selected it's used
|
||||||
if test -z "$SKIP_BEOS"; then
|
if test -z "$SKIP_BEOS"; then
|
||||||
|
@ -2114,7 +2114,7 @@ do_one_cmd(cmdlinep, sourcing,
|
|||||||
*/
|
*/
|
||||||
if ((ea.cmdidx == CMD_make
|
if ((ea.cmdidx == CMD_make
|
||||||
|| ea.cmdidx == CMD_grep || ea.cmdidx == CMD_grepadd)
|
|| ea.cmdidx == CMD_grep || ea.cmdidx == CMD_grepadd)
|
||||||
&& !grep_internal(&ea))
|
&& !grep_internal(ea.cmdidx))
|
||||||
{
|
{
|
||||||
char_u *new_cmdline;
|
char_u *new_cmdline;
|
||||||
char_u *program;
|
char_u *program;
|
||||||
@ -3164,7 +3164,13 @@ set_one_cmd_context(xp, buff)
|
|||||||
p++;
|
p++;
|
||||||
xp->xp_pattern = 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;
|
int in_quote = FALSE;
|
||||||
char_u *bow = NULL; /* Beginning of word */
|
char_u *bow = NULL; /* Beginning of word */
|
||||||
@ -4204,14 +4210,19 @@ separate_nextcmd(eap)
|
|||||||
|
|
||||||
p = eap->arg;
|
p = eap->arg;
|
||||||
#ifdef FEAT_QUICKFIX
|
#ifdef FEAT_QUICKFIX
|
||||||
if (eap->cmdidx == CMD_vimgrep
|
if (*p != NUL && (eap->cmdidx == CMD_vimgrep
|
||||||
|| eap->cmdidx == CMD_vimgrepadd
|
|| eap->cmdidx == CMD_vimgrepadd
|
||||||
|| grep_internal(eap))
|
|| grep_internal(eap->cmdidx)))
|
||||||
{
|
{
|
||||||
/* Skip over the pattern. */
|
/* Skip over the pattern. */
|
||||||
p = skip_regexp(p + 1, *p, TRUE, NULL);
|
if (vim_isIDc(*p))
|
||||||
if (*p == *eap->arg)
|
p = skiptowhite(p);
|
||||||
++p;
|
else
|
||||||
|
{
|
||||||
|
p = skip_regexp(p + 1, *p, TRUE, NULL);
|
||||||
|
if (*p == *eap->arg)
|
||||||
|
++p;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -2080,7 +2080,8 @@ cmdline_at_end()
|
|||||||
}
|
}
|
||||||
#endif
|
#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.
|
* 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.
|
* This is used by the IM code to obtain the start of the preedit string.
|
||||||
|
@ -650,7 +650,8 @@
|
|||||||
* +xfontset X fontset support. For outputting wide characters.
|
* +xfontset X fontset support. For outputting wide characters.
|
||||||
*/
|
*/
|
||||||
#ifndef FEAT_XFONTSET
|
#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
|
# define FEAT_XFONTSET
|
||||||
# else
|
# else
|
||||||
/* # define FEAT_XFONTSET */
|
/* # define FEAT_XFONTSET */
|
||||||
@ -1172,7 +1173,7 @@
|
|||||||
|| defined(FEAT_NETBEANS_INTG))
|
|| defined(FEAT_NETBEANS_INTG))
|
||||||
# define FEAT_BEVAL
|
# define FEAT_BEVAL
|
||||||
# if !defined(FEAT_XFONTSET) && !defined(FEAT_GUI_GTK) \
|
# if !defined(FEAT_XFONTSET) && !defined(FEAT_GUI_GTK) \
|
||||||
&& !defined(FEAT_GUI_W32)
|
&& !defined(FEAT_GUI_KDE) && !defined(FEAT_GUI_W32)
|
||||||
# define FEAT_XFONTSET
|
# define FEAT_XFONTSET
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -725,6 +725,7 @@ EXTERN int* (*iconv_errno) (void);
|
|||||||
#ifdef FEAT_XIM
|
#ifdef FEAT_XIM
|
||||||
# ifdef FEAT_GUI_KDE
|
# ifdef FEAT_GUI_KDE
|
||||||
EXTERN colnr_T preedit_start_col INIT(= MAXCOL);
|
EXTERN colnr_T preedit_start_col INIT(= MAXCOL);
|
||||||
|
EXTERN colnr_T preedit_end_col INIT(= MAXCOL);
|
||||||
EXTERN char *draw_feedback INIT(= NULL);
|
EXTERN char *draw_feedback INIT(= NULL);
|
||||||
# endif
|
# endif
|
||||||
# ifdef FEAT_GUI_GTK
|
# ifdef FEAT_GUI_GTK
|
||||||
|
10
src/gui.c
10
src/gui.c
@ -1918,7 +1918,7 @@ gui_outstr_nowrap(s, len, flags, fg, bg, back)
|
|||||||
long_u hl_mask_todo;
|
long_u hl_mask_todo;
|
||||||
guicolor_T fg_color;
|
guicolor_T fg_color;
|
||||||
guicolor_T bg_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;
|
GuiFont font = NOFONT;
|
||||||
# ifdef FEAT_XFONTSET
|
# ifdef FEAT_XFONTSET
|
||||||
GuiFontset fontset = NOFONTSET;
|
GuiFontset fontset = NOFONTSET;
|
||||||
@ -1972,7 +1972,7 @@ gui_outstr_nowrap(s, len, flags, fg, bg, back)
|
|||||||
highlight_mask = gui.highlight_mask;
|
highlight_mask = gui.highlight_mask;
|
||||||
hl_mask_todo = 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 */
|
/* Set the font */
|
||||||
if (aep != NULL && aep->ae_u.gui.font != NOFONT)
|
if (aep != NULL && aep->ae_u.gui.font != NOFONT)
|
||||||
font = aep->ae_u.gui.font;
|
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
|
/* print the string so far if it's the last character or there is
|
||||||
* a composing character. */
|
* a composing character. */
|
||||||
if (i + cl >= len || (comping && i > start) || dowide
|
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
|
|| (cn > 1
|
||||||
# ifdef FEAT_XFONTSET
|
# ifdef FEAT_XFONTSET
|
||||||
/* No fontset: At least draw char after wide char at
|
/* 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;
|
cells = 0;
|
||||||
if (dowide)
|
if (dowide)
|
||||||
{
|
{
|
||||||
|
#ifndef FEAT_GUI_KDE
|
||||||
gui_mch_set_font(gui.wide_font);
|
gui_mch_set_font(gui.wide_font);
|
||||||
|
#endif
|
||||||
gui_mch_draw_string(gui.row, scol - cn,
|
gui_mch_draw_string(gui.row, scol - cn,
|
||||||
s + start, cl, draw_flags);
|
s + start, cl, draw_flags);
|
||||||
|
#ifndef FEAT_GUI_KDE
|
||||||
gui_mch_set_font(font);
|
gui_mch_set_font(font);
|
||||||
|
#endif
|
||||||
start += cl;
|
start += cl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -206,9 +206,7 @@ pixmap_create_by_dir(char_u *name)//{{{
|
|||||||
char_u full_pathname[MAXPATHL + 1];
|
char_u full_pathname[MAXPATHL + 1];
|
||||||
|
|
||||||
if (gui_find_bitmap(name, full_pathname, "xpm") == OK)
|
if (gui_find_bitmap(name, full_pathname, "xpm") == OK)
|
||||||
{
|
|
||||||
return QPixmap((const char *)full_pathname);
|
return QPixmap((const char *)full_pathname);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
return QPixmap();
|
return QPixmap();
|
||||||
}//}}}
|
}//}}}
|
||||||
@ -222,7 +220,7 @@ pixmap_create_from_file(char_u *file)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
gui_mch_add_menu(vimmenu_T * menu, int idx)//{{{
|
gui_mch_add_menu(vimmenu_T *menu, int idx)//{{{
|
||||||
{
|
{
|
||||||
#ifdef FEAT_MENU
|
#ifdef FEAT_MENU
|
||||||
QPopupMenu *me;
|
QPopupMenu *me;
|
||||||
@ -230,7 +228,7 @@ gui_mch_add_menu(vimmenu_T * menu, int idx)//{{{
|
|||||||
|
|
||||||
if (menu_is_popup(menu->name))
|
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,
|
QObject::connect(menu->widget, SIGNAL(activated(int)), vmw,
|
||||||
SLOT(menu_activated(int)));
|
SLOT(menu_activated(int)));
|
||||||
return;
|
return;
|
||||||
@ -242,15 +240,13 @@ gui_mch_add_menu(vimmenu_T * menu, int idx)//{{{
|
|||||||
if (parent)
|
if (parent)
|
||||||
{
|
{
|
||||||
idx++; // for tearoffs to be first in menus
|
idx++; // for tearoffs to be first in menus
|
||||||
me = new QPopupMenu(parent->widget, (const char *)menu->name);
|
me = new QPopupMenu(parent->widget, QSTR(menu->name));
|
||||||
parent->widget->insertItem(QString((const char *)menu->name), me,
|
parent->widget->insertItem(QSTR(menu->name), me, (int)me, idx);
|
||||||
(int)me, idx);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
me = new QPopupMenu(vmw->menuBar() , (const char *)menu->name);
|
me = new QPopupMenu(vmw->menuBar(), QSTR(menu->name));
|
||||||
vmw->menuBar()->insertItem(QString((const char *)menu->name), me,
|
vmw->menuBar()->insertItem(QSTR(menu->name), me, (int)me, idx);
|
||||||
(int)me, idx);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
me->setCaption((const char *)(menu->dname));
|
me->setCaption((const char *)(menu->dname));
|
||||||
@ -264,7 +260,7 @@ gui_mch_add_menu(vimmenu_T * menu, int idx)//{{{
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
gui_mch_add_menu_item(vimmenu_T * menu, int idx)//{{{
|
gui_mch_add_menu_item(vimmenu_T *menu, int idx)//{{{
|
||||||
{
|
{
|
||||||
#ifdef FEAT_MENU
|
#ifdef FEAT_MENU
|
||||||
vimmenu_T *parent = menu->parent;
|
vimmenu_T *parent = menu->parent;
|
||||||
@ -302,7 +298,7 @@ gui_mch_add_menu_item(vimmenu_T * menu, int idx)//{{{
|
|||||||
pix,
|
pix,
|
||||||
(int)menu, // id
|
(int)menu, // id
|
||||||
true,
|
true,
|
||||||
(char *)(menu->strings[MENU_INDEX_TIP]), // tooltip or text
|
QSTR(menu->strings[MENU_INDEX_TIP]), // tooltip or text
|
||||||
idx);
|
idx);
|
||||||
menu->parent=parent;
|
menu->parent=parent;
|
||||||
return;
|
return;
|
||||||
@ -315,7 +311,7 @@ gui_mch_add_menu_item(vimmenu_T * menu, int idx)//{{{
|
|||||||
parent->widget->insertSeparator();
|
parent->widget->insertSeparator();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
parent->widget->insertItem(QString((const char *)menu->name), (int)menu, idx);
|
parent->widget->insertItem(QSTR(menu->name), (int)menu, idx);
|
||||||
#endif
|
#endif
|
||||||
}//}}}
|
}//}}}
|
||||||
|
|
||||||
@ -378,8 +374,8 @@ toggle_tearoffs(vimmenu_T *menu, int enable)//{{{
|
|||||||
void
|
void
|
||||||
gui_mch_toggle_tearoffs(int enable)//{{{
|
gui_mch_toggle_tearoffs(int enable)//{{{
|
||||||
{
|
{
|
||||||
vmw->have_tearoff=enable;
|
vmw->have_tearoff=enable;
|
||||||
toggle_tearoffs(root_menu, enable);
|
toggle_tearoffs(root_menu, enable);
|
||||||
}//}}}
|
}//}}}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -389,7 +385,7 @@ gui_mch_toggle_tearoffs(int enable)//{{{
|
|||||||
* Destroy the machine specific menu widget.
|
* Destroy the machine specific menu widget.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
gui_mch_destroy_menu(vimmenu_T * menu)//{{{
|
gui_mch_destroy_menu(vimmenu_T *menu)//{{{
|
||||||
{
|
{
|
||||||
#ifdef FEAT_TOOLBAR
|
#ifdef FEAT_TOOLBAR
|
||||||
if (menu->parent && menu_is_toolbar(menu->parent->name))
|
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)
|
if (!sb->w)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//we add the menubar and toolbar height/width
|
//we add the menubar and toolbar height/width
|
||||||
int X = 0;
|
int X = 0;
|
||||||
int Y = 0;
|
int Y = 0;
|
||||||
@ -480,7 +477,7 @@ gui_mch_create_scrollbar(scrollbar_T *sb, int orient)//{{{
|
|||||||
}//}}}
|
}//}}}
|
||||||
|
|
||||||
void
|
void
|
||||||
gui_mch_destroy_scrollbar(scrollbar_T * sb)//{{{
|
gui_mch_destroy_scrollbar(scrollbar_T *sb)//{{{
|
||||||
{
|
{
|
||||||
sbpool->destroy(sb);
|
sbpool->destroy(sb);
|
||||||
}//}}}
|
}//}}}
|
||||||
@ -503,11 +500,11 @@ gui_mch_destroy_scrollbar(scrollbar_T * sb)//{{{
|
|||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
char_u *
|
char_u *
|
||||||
gui_mch_browse(int saving,//{{{
|
gui_mch_browse(int saving,//{{{
|
||||||
char_u * title,
|
char_u *title,
|
||||||
char_u * dflt,
|
char_u *dflt,
|
||||||
char_u * ext,
|
char_u *ext,
|
||||||
char_u * initdir,
|
char_u *initdir,
|
||||||
char_u * filter)
|
char_u *filter)
|
||||||
{
|
{
|
||||||
char *filt_glob;
|
char *filt_glob;
|
||||||
|
|
||||||
@ -524,8 +521,8 @@ gui_mch_browse(int saving,//{{{
|
|||||||
|
|
||||||
QString s;
|
QString s;
|
||||||
if (!saving)
|
if (!saving)
|
||||||
s = KFileDialog::getOpenFileName((char *)initdir, (char *)filt_glob,
|
s = KFileDialog::getOpenFileName(QSTR(initdir), QSTR(filt_glob),
|
||||||
vmw, (char *)title);
|
vmw, QSTR(title));
|
||||||
else
|
else
|
||||||
s = KFileDialog::getSaveFileName();
|
s = KFileDialog::getSaveFileName();
|
||||||
|
|
||||||
@ -552,7 +549,7 @@ gui_mch_dialog(int type, /* type of dialog *///{{{
|
|||||||
char_u *title, /* title of dialog */
|
char_u *title, /* title of dialog */
|
||||||
char_u *message, /* message text */
|
char_u *message, /* message text */
|
||||||
char_u *buttons, /* names of buttons */
|
char_u *buttons, /* names of buttons */
|
||||||
int def_but, /* default button */
|
int def_but, /* default button */
|
||||||
char_u *textfield)
|
char_u *textfield)
|
||||||
{
|
{
|
||||||
gui_mch_mousehide(FALSE);
|
gui_mch_mousehide(FALSE);
|
||||||
@ -566,7 +563,7 @@ gui_mch_dialog(int type, /* type of dialog *///{{{
|
|||||||
|
|
||||||
#if defined(FEAT_MENU) || defined(PROTO)
|
#if defined(FEAT_MENU) || defined(PROTO)
|
||||||
void
|
void
|
||||||
gui_mch_show_popupmenu(vimmenu_T * menu)//{{{
|
gui_mch_show_popupmenu(vimmenu_T *menu)//{{{
|
||||||
{
|
{
|
||||||
menu->widget->popup(QCursor::pos());
|
menu->widget->popup(QCursor::pos());
|
||||||
}//}}}
|
}//}}}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -68,7 +68,8 @@ class QLineEdit;
|
|||||||
class QSignalMapper;
|
class QSignalMapper;
|
||||||
class QPaintEvent;
|
class QPaintEvent;
|
||||||
|
|
||||||
enum BlinkState {
|
enum BlinkState
|
||||||
|
{
|
||||||
BLINK_NONE,
|
BLINK_NONE,
|
||||||
BLINK_ON,
|
BLINK_ON,
|
||||||
BLINK_OFF
|
BLINK_OFF
|
||||||
@ -79,12 +80,12 @@ class VimWidget : public QWidget, virtual public KVim
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
VimWidget( QWidget *parent=0, const char *name=0, WFlags f=0 );
|
VimWidget(QWidget *parent = 0, const char *name = 0, WFlags f = 0);
|
||||||
virtual void paintEvent( QPaintEvent *);
|
virtual void paintEvent(QPaintEvent *);
|
||||||
void draw_string(int x, int y, QString s, int len, int flags);
|
void draw_string(int x, int y, QString s, int len, int flags);
|
||||||
|
|
||||||
/** Init the blinking time */
|
/** Init the blinking time */
|
||||||
void set_blink_time( long, long, long );
|
void set_blink_time(long, long, long);
|
||||||
void start_cursor_blinking();
|
void start_cursor_blinking();
|
||||||
void stop_cursor_blinking();
|
void stop_cursor_blinking();
|
||||||
void wait(long);
|
void wait(long);
|
||||||
@ -108,24 +109,28 @@ public:
|
|||||||
BlinkState blink_state;
|
BlinkState blink_state;
|
||||||
QPainter *painter;
|
QPainter *painter;
|
||||||
QPopupMenu *menu;
|
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:
|
protected:
|
||||||
virtual void keyPressEvent( QKeyEvent * );
|
virtual void keyPressEvent(QKeyEvent *);
|
||||||
virtual void mousePressEvent( QMouseEvent *);
|
virtual void mousePressEvent(QMouseEvent *);
|
||||||
virtual void mouseDoubleClickEvent( QMouseEvent *);
|
virtual void mouseDoubleClickEvent(QMouseEvent *);
|
||||||
virtual void mouseReleaseEvent( QMouseEvent *);
|
virtual void mouseReleaseEvent(QMouseEvent *);
|
||||||
virtual void mouseMoveEvent( QMouseEvent *);
|
virtual void mouseMoveEvent(QMouseEvent *);
|
||||||
virtual void focusInEvent( QFocusEvent * );
|
virtual void focusInEvent(QFocusEvent *);
|
||||||
virtual void focusOutEvent( QFocusEvent * );
|
virtual void focusOutEvent(QFocusEvent *);
|
||||||
virtual void dragEnterEvent (QDragEnterEvent *);
|
virtual void dragEnterEvent(QDragEnterEvent *);
|
||||||
virtual void dropEvent (QDropEvent *);
|
virtual void dropEvent(QDropEvent *);
|
||||||
#ifdef FEAT_XIM
|
#ifdef FEAT_XIM
|
||||||
virtual void imStartEvent ( QIMEvent * );
|
virtual void imStartEvent(QIMEvent *);
|
||||||
virtual void imEndEvent ( QIMEvent * );
|
virtual void imEndEvent(QIMEvent *);
|
||||||
virtual void imComposeEvent ( QIMEvent * );
|
virtual void imComposeEvent(QIMEvent *);
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_MZSCHEME
|
#ifdef FEAT_MZSCHEME
|
||||||
virtual void timerEvent( QTimerEvent * );
|
virtual void timerEvent(QTimerEvent *);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* cursor blinking stuff */
|
/* cursor blinking stuff */
|
||||||
@ -149,24 +154,24 @@ class VimMainWindow : public KMainWindow
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
VimMainWindow ( const char *name = 0L, WFlags f = WDestructiveClose );
|
VimMainWindow(const char *name = 0L, WFlags f = WDestructiveClose);
|
||||||
|
|
||||||
/** called when the widget closes */
|
/** called when the widget closes */
|
||||||
// bool close(bool alsoDelete);
|
// bool close(bool alsoDelete);
|
||||||
VimWidget *w;
|
VimWidget *w;
|
||||||
KEdFind *finddlg;
|
KEdFind *finddlg;
|
||||||
KEdReplace *repldlg;
|
KEdReplace *repldlg;
|
||||||
int have_tearoff;
|
int have_tearoff;
|
||||||
QTextCodec *codec;
|
QTextCodec *codec;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void menu_activated(int dx);
|
void menu_activated(int dx);
|
||||||
void clipboard_selection_update();
|
void clipboard_selection_update();
|
||||||
void clipboard_data_update();
|
void clipboard_data_update();
|
||||||
void slotSearch();
|
void slotSearch();
|
||||||
void slotFind();
|
void slotFind();
|
||||||
void slotReplace();
|
void slotReplace();
|
||||||
void slotReplaceAll();
|
void slotReplaceAll();
|
||||||
void showAboutApplication();
|
void showAboutApplication();
|
||||||
void showAboutKDE();
|
void showAboutKDE();
|
||||||
void showBugReport();
|
void showBugReport();
|
||||||
@ -177,12 +182,12 @@ public slots:
|
|||||||
void unlock();
|
void unlock();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void wheelEvent (QWheelEvent *);
|
virtual void wheelEvent(QWheelEvent *);
|
||||||
virtual void resizeEvent ( QResizeEvent *e );
|
virtual void resizeEvent(QResizeEvent *e);
|
||||||
|
|
||||||
#if defined(FEAT_SESSION)
|
#if defined(FEAT_SESSION)
|
||||||
void saveGlobalProperties (KConfig *conf);
|
void saveGlobalProperties(KConfig *conf);
|
||||||
void readGlobalProperties (KConfig *conf);
|
void readGlobalProperties(KConfig *conf);
|
||||||
#endif
|
#endif
|
||||||
bool queryClose();
|
bool queryClose();
|
||||||
bool queryExit();
|
bool queryExit();
|
||||||
@ -194,10 +199,10 @@ class VimDialog : public QDialog
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
VimDialog (int type, /* type of dialog */
|
VimDialog(int type, /* type of dialog */
|
||||||
unsigned char * title, /* title of dialog */
|
unsigned char *title, /* title of dialog */
|
||||||
unsigned char * message, /* message text */
|
unsigned char *message, /* message text */
|
||||||
unsigned char * buttons, /* names of buttons */
|
unsigned char *buttons, /* names of buttons */
|
||||||
int def_but, /* default button */
|
int def_but, /* default button */
|
||||||
char_u *textfield); /* input text */
|
char_u *textfield); /* input text */
|
||||||
private:
|
private:
|
||||||
@ -229,7 +234,8 @@ private:
|
|||||||
QSignalMapper mapper;
|
QSignalMapper mapper;
|
||||||
};
|
};
|
||||||
|
|
||||||
class KVimUtils {
|
class KVimUtils
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
static QString convertEncodingName(QString);
|
static QString convertEncodingName(QString);
|
||||||
#if QT_VERSION<300
|
#if QT_VERSION<300
|
||||||
@ -240,6 +246,13 @@ public:
|
|||||||
|
|
||||||
extern VimMainWindow *vmw;
|
extern VimMainWindow *vmw;
|
||||||
extern SBPool *sbpool;
|
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
|
#endif // GUI_KDE_WIDGET
|
||||||
|
1447
src/gui_kde_x11.cc
1447
src/gui_kde_x11.cc
File diff suppressed because it is too large
Load Diff
10
src/mbyte.c
10
src/mbyte.c
@ -4341,6 +4341,7 @@ xim_set_focus(focus)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef FEAT_GUI_KDE
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
void
|
void
|
||||||
im_set_position(row, col)
|
im_set_position(row, col)
|
||||||
@ -4349,6 +4350,7 @@ im_set_position(row, col)
|
|||||||
{
|
{
|
||||||
xim_set_preedit();
|
xim_set_preedit();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set the XIM to the current cursor position.
|
* Set the XIM to the current cursor position.
|
||||||
@ -4642,7 +4644,7 @@ xim_set_status_area()
|
|||||||
#endif
|
#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");
|
static char e_xim[] = N_("E285: Failed to create input context");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -5414,7 +5416,7 @@ xim_get_status_area_height()
|
|||||||
if (xim_input_style & (int)GDK_IM_STATUS_AREA)
|
if (xim_input_style & (int)GDK_IM_STATUS_AREA)
|
||||||
return gui.char_height;
|
return gui.char_height;
|
||||||
#elif defined FEAT_GUI_KDE
|
#elif defined FEAT_GUI_KDE
|
||||||
#warning FIXME
|
/* always return zero? */
|
||||||
#else
|
#else
|
||||||
if (status_area_enabled)
|
if (status_area_enabled)
|
||||||
return gui.char_height;
|
return gui.char_height;
|
||||||
@ -5434,6 +5436,10 @@ im_get_status()
|
|||||||
# ifdef FEAT_GUI_GTK
|
# ifdef FEAT_GUI_GTK
|
||||||
if (xim_input_style & (int)GDK_IM_PREEDIT_CALLBACKS)
|
if (xim_input_style & (int)GDK_IM_PREEDIT_CALLBACKS)
|
||||||
return xim_can_preediting;
|
return xim_can_preediting;
|
||||||
|
# endif
|
||||||
|
# ifdef FEAT_GUI_KDE
|
||||||
|
if (preedit_start_col != MAXCOL)
|
||||||
|
return TRUE;
|
||||||
# endif
|
# endif
|
||||||
return xim_has_focus;
|
return xim_has_focus;
|
||||||
}
|
}
|
||||||
|
@ -1320,14 +1320,13 @@ x_error_handler(dpy, error_event)
|
|||||||
Display *dpy;
|
Display *dpy;
|
||||||
XErrorEvent *error_event;
|
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);
|
XGetErrorText(dpy, error_event->error_code, (char *)IObuff, IOSIZE);
|
||||||
STRCAT(IObuff, "\nVim: Got X error but we continue...\n");
|
#if defined(FEAT_GUI_KDE)
|
||||||
fprintf(stderr, IObuff);
|
/* 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;
|
return 0;
|
||||||
#else
|
#else
|
||||||
XGetErrorText(dpy, error_event->error_code, (char *)IObuff, IOSIZE);
|
|
||||||
STRCAT(IObuff, _("\nVim: Got X error\n"));
|
STRCAT(IObuff, _("\nVim: Got X error\n"));
|
||||||
|
|
||||||
/* We cannot print a message and continue, because no X calls are allowed
|
/* We cannot print a message and continue, because no X calls are allowed
|
||||||
|
@ -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));
|
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));
|
int buflist_getfile __ARGS((int n, linenr_T lnum, int options, int forceit));
|
||||||
void buflist_getfpos __ARGS((void));
|
void buflist_getfpos __ARGS((void));
|
||||||
|
buf_T *buflist_findname_exp __ARGS((char_u *fname));
|
||||||
buf_T *buflist_findname __ARGS((char_u *ffname));
|
buf_T *buflist_findname __ARGS((char_u *ffname));
|
||||||
int buflist_findpat __ARGS((char_u *pattern, char_u *pattern_end, int unlisted, int diffmode));
|
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));
|
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));
|
linenr_T buflist_findlnum __ARGS((buf_T *buf));
|
||||||
void buflist_list __ARGS((exarg_T *eap));
|
void buflist_list __ARGS((exarg_T *eap));
|
||||||
int buflist_name_nr __ARGS((int fnum, char_u **fname, linenr_T *lnum));
|
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_set_name __ARGS((int fnum, char_u *name));
|
||||||
void buf_name_changed __ARGS((buf_T *buf));
|
void buf_name_changed __ARGS((buf_T *buf));
|
||||||
buf_T *setaltfname __ARGS((char_u *ffname, char_u *sfname, linenr_T lnum));
|
buf_T *setaltfname __ARGS((char_u *ffname, char_u *sfname, linenr_T lnum));
|
||||||
|
@ -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));
|
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));
|
int gui_mch_init_font __ARGS((char_u *font_name, int fontset));
|
||||||
GuiFont gui_mch_get_font __ARGS((char_u *name, int report_error));
|
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_font __ARGS((GuiFont font));
|
||||||
void gui_mch_set_fontset __ARGS((GuiFontset fontset));
|
void gui_mch_set_fontset __ARGS((GuiFontset fontset));
|
||||||
void gui_mch_free_font __ARGS((GuiFont font));
|
void gui_mch_free_font __ARGS((GuiFont font));
|
||||||
|
213
src/quickfix.c
213
src/quickfix.c
@ -105,6 +105,9 @@ static void qf_update_buffer __ARGS((void));
|
|||||||
static void qf_fill_buffer __ARGS((void));
|
static void qf_fill_buffer __ARGS((void));
|
||||||
#endif
|
#endif
|
||||||
static char_u *get_mef_name __ARGS((void));
|
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
|
* 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".
|
* Return TRUE when using ":vimgrep" for ":grep".
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
grep_internal(eap)
|
grep_internal(cmdidx)
|
||||||
exarg_T *eap;
|
cmdidx_T cmdidx;
|
||||||
{
|
{
|
||||||
return ((eap->cmdidx == CMD_grep || eap->cmdidx == CMD_grepadd)
|
return ((cmdidx == CMD_grep || cmdidx == CMD_grepadd)
|
||||||
&& STRCMP("internal",
|
&& STRCMP("internal",
|
||||||
*curbuf->b_p_gp == NUL ? p_gp : curbuf->b_p_gp) == 0);
|
*curbuf->b_p_gp == NUL ? p_gp : curbuf->b_p_gp) == 0);
|
||||||
}
|
}
|
||||||
@ -2083,7 +2086,7 @@ ex_make(eap)
|
|||||||
unsigned len;
|
unsigned len;
|
||||||
|
|
||||||
/* Redirect ":grep" to ":vimgrep" if 'grepprg' is "internal". */
|
/* Redirect ":grep" to ":vimgrep" if 'grepprg' is "internal". */
|
||||||
if (grep_internal(eap))
|
if (grep_internal(eap->cmdidx))
|
||||||
{
|
{
|
||||||
ex_vimgrep(eap);
|
ex_vimgrep(eap);
|
||||||
return;
|
return;
|
||||||
@ -2249,35 +2252,50 @@ ex_cfile(eap)
|
|||||||
ex_vimgrep(eap)
|
ex_vimgrep(eap)
|
||||||
exarg_T *eap;
|
exarg_T *eap;
|
||||||
{
|
{
|
||||||
regmatch_T regmatch;
|
regmmatch_T regmatch;
|
||||||
char_u *save_cpo;
|
char_u *save_cpo;
|
||||||
int fcount;
|
int fcount;
|
||||||
char_u **fnames;
|
char_u **fnames;
|
||||||
|
char_u *s;
|
||||||
char_u *p;
|
char_u *p;
|
||||||
int i;
|
int i;
|
||||||
FILE *fd;
|
|
||||||
int fi;
|
int fi;
|
||||||
struct qf_line *prevp = NULL;
|
struct qf_line *prevp = NULL;
|
||||||
long lnum;
|
long lnum;
|
||||||
garray_T ga;
|
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. */
|
/* Make 'cpoptions' empty, the 'l' flag should not be used here. */
|
||||||
save_cpo = p_cpo;
|
save_cpo = p_cpo;
|
||||||
p_cpo = empty_option;
|
p_cpo = empty_option;
|
||||||
|
|
||||||
/* Get the search pattern */
|
/* Get the search pattern: either white-separated or enclosed in // */
|
||||||
regmatch.regprog = NULL;
|
regmatch.regprog = NULL;
|
||||||
p = skip_regexp(eap->arg + 1, *eap->arg, TRUE, NULL);
|
if (vim_isIDc(*eap->arg))
|
||||||
if (*p != *eap->arg)
|
|
||||||
{
|
{
|
||||||
EMSG(_("E682: Invalid search pattern or delimiter"));
|
s = eap->arg;
|
||||||
goto theend;
|
p = skiptowhite(s);
|
||||||
}
|
}
|
||||||
*p++ = NUL;
|
else
|
||||||
regmatch.regprog = vim_regcomp(eap->arg + 1, RE_MAGIC);
|
{
|
||||||
|
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)
|
if (regmatch.regprog == NULL)
|
||||||
goto theend;
|
goto theend;
|
||||||
regmatch.rm_ic = FALSE;
|
regmatch.rmm_ic = FALSE;
|
||||||
|
|
||||||
p = skipwhite(p);
|
p = skipwhite(p);
|
||||||
if (*p == NUL)
|
if (*p == NUL)
|
||||||
@ -2312,28 +2330,37 @@ ex_vimgrep(eap)
|
|||||||
|
|
||||||
for (fi = 0; fi < fcount && !got_int; ++fi)
|
for (fi = 0; fi < fcount && !got_int; ++fi)
|
||||||
{
|
{
|
||||||
fd = fopen((char *)fnames[fi], "r");
|
buf = buflist_findname_exp(fnames[fi]);
|
||||||
if (fd == NULL)
|
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]);
|
smsg((char_u *)_("Cannot open file \"%s\""), fnames[fi]);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
lnum = 1;
|
found_match = FALSE;
|
||||||
while (!vim_fgets(IObuff, IOSIZE, fd) && !got_int)
|
for (lnum = 1; lnum <= buf->b_ml.ml_line_count; ++lnum)
|
||||||
{
|
{
|
||||||
if (vim_regexec(®match, IObuff, (colnr_T)0))
|
if (vim_regexec_multi(®match, 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,
|
if (qf_add_entry(&prevp,
|
||||||
NULL, /* dir */
|
NULL, /* dir */
|
||||||
fnames[fi],
|
fnames[fi],
|
||||||
IObuff,
|
ml_get_buf(buf,
|
||||||
lnum,
|
regmatch.startpos[0].lnum + lnum, FALSE),
|
||||||
(int)(regmatch.startp[0] - IObuff) + 1,/* col */
|
regmatch.startpos[0].lnum + lnum,
|
||||||
|
regmatch.startpos[0].col + 1,
|
||||||
FALSE, /* virt_col */
|
FALSE, /* virt_col */
|
||||||
0, /* nr */
|
0, /* nr */
|
||||||
0, /* type */
|
0, /* type */
|
||||||
@ -2343,11 +2370,34 @@ ex_vimgrep(eap)
|
|||||||
got_int = TRUE;
|
got_int = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
found_match = TRUE;
|
||||||
}
|
}
|
||||||
++lnum;
|
|
||||||
line_breakcheck();
|
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. */
|
/* Jump to first match. */
|
||||||
if (qf_lists[qf_curlist].qf_count > 0)
|
if (qf_lists[qf_curlist].qf_count > 0)
|
||||||
qf_jump(0, 0, FALSE);
|
qf_jump(0, 0, FALSE);
|
||||||
|
else
|
||||||
|
EMSG2(_(e_nomatch2), s);
|
||||||
|
|
||||||
theend:
|
theend:
|
||||||
vim_free(regmatch.regprog);
|
vim_free(regmatch.regprog);
|
||||||
@ -2375,6 +2427,104 @@ theend:
|
|||||||
free_string_option(save_cpo);
|
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.
|
* ":[range]cbuffer [bufnr]" command.
|
||||||
*/
|
*/
|
||||||
@ -2487,7 +2637,8 @@ ex_helpgrep(eap)
|
|||||||
fnames[fi],
|
fnames[fi],
|
||||||
IObuff,
|
IObuff,
|
||||||
lnum,
|
lnum,
|
||||||
0, /* col */
|
(int)(regmatch.startp[0] - IObuff)
|
||||||
|
+ 1, /* col */
|
||||||
FALSE, /* virt_col */
|
FALSE, /* virt_col */
|
||||||
0, /* nr */
|
0, /* nr */
|
||||||
1, /* type */
|
1, /* type */
|
||||||
|
@ -3780,7 +3780,7 @@ win_line(wp, lnum, startrow, endrow)
|
|||||||
&& (search_attr == 0 || char_attr != search_attr))
|
&& (search_attr == 0 || char_attr != search_attr))
|
||||||
char_attr = extra_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
|
/* 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
|
* preedit_changed and commit. Thus Vim can't set "im_is_active", use
|
||||||
* im_is_preediting() here. */
|
* im_is_preediting() here. */
|
||||||
@ -4771,7 +4771,7 @@ status_match_len(xp, s)
|
|||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
++s;
|
++s;
|
||||||
len += ptr2cells(s++);
|
len += ptr2cells(s);
|
||||||
mb_ptr_adv(s);
|
mb_ptr_adv(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,5 +36,5 @@
|
|||||||
#define VIM_VERSION_NODOT "vim70aa"
|
#define VIM_VERSION_NODOT "vim70aa"
|
||||||
#define VIM_VERSION_SHORT "7.0aa"
|
#define VIM_VERSION_SHORT "7.0aa"
|
||||||
#define VIM_VERSION_MEDIUM "7.0aa ALPHA"
|
#define VIM_VERSION_MEDIUM "7.0aa ALPHA"
|
||||||
#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2004 Dec 24)"
|
#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 24, compiled "
|
#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2004 Dec 29, compiled "
|
||||||
|
@ -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 0x10 /* file didn't exist when editing started */
|
||||||
#define BF_NEW_W 0x20 /* Warned for BF_NEW and file created */
|
#define BF_NEW_W 0x20 /* Warned for BF_NEW and file created */
|
||||||
#define BF_READERR 0x40 /* got errors while reading the file */
|
#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 */
|
/* Mask to check for flags that prevent normal writing */
|
||||||
#define BF_WRITE_MASK (BF_NOTEDITED + BF_NEW + BF_READERR)
|
#define BF_WRITE_MASK (BF_NOTEDITED + BF_NEW + BF_READERR)
|
||||||
|
Reference in New Issue
Block a user