Merge remote-tracking branch 'vim/master'

This commit is contained in:
ichizok
2022-05-22 18:21:47 +09:00
71 changed files with 9900 additions and 5873 deletions
+8 -1
View File
@@ -97,6 +97,7 @@ runtime/ftplugin/clojure.vim @axvr
runtime/ftplugin/csh.vim @dkearns
runtime/ftplugin/css.vim @dkearns
runtime/ftplugin/cucumber.vim @tpope
runtime/ftplugin/dosbatch.vim @mrdubya
runtime/ftplugin/eiffel.vim @dkearns
runtime/ftplugin/eruby.vim @tpope @dkearns
runtime/ftplugin/fpcmake.vim @dkearns
@@ -129,6 +130,7 @@ runtime/ftplugin/octave.vim @dkearns
runtime/ftplugin/pascal.vim @dkearns
runtime/ftplugin/pbtxt.vim @lakshayg
runtime/ftplugin/pdf.vim @tpope
runtime/ftplugin/postscr.vim @mrdubya
runtime/ftplugin/ps1.vim @heaths
runtime/ftplugin/ps1xml.vim @heaths
runtime/ftplugin/qb64.vim @dkearns
@@ -176,7 +178,7 @@ runtime/indent/mma.vim @dkearns
runtime/indent/nginx.vim @chr4
runtime/indent/nsis.vim @k-takata
runtime/indent/occam.vim @dkearns
runtime/indent/postscr.vim @dkearns
runtime/indent/postscr.vim @mrdubya
runtime/indent/prolog.vim @dkearns
runtime/indent/ps1.vim @heaths
runtime/indent/qb64.vim @dkearns
@@ -192,6 +194,7 @@ runtime/indent/teraterm.vim @k-takata
runtime/indent/xml.vim @chrisbra
runtime/indent/zsh.vim @chrisbra
runtime/keymap/tamil_tscii.vim @yegappan
runtime/lang/menu_en_gb.latin1.vim @mrdubya
runtime/pack/dist/opt/cfilter/plugin/cfilter.vim @yegappan
runtime/pack/dist/opt/matchit/ @chrisbra
runtime/plugin/getscriptPlugin.vim @cecamp
@@ -219,6 +222,7 @@ runtime/syntax/cucumber.vim @tpope
runtime/syntax/datascript.vim @dpelle
runtime/syntax/dcl.vim @cecamp
runtime/syntax/desktop.vim @e-kwsm
runtime/syntax/dosbatch.vim @mrdubya
runtime/syntax/dot.vim @mmottl
runtime/syntax/doxygen.vim @frogonwheels
runtime/syntax/dtd.vim @chrisbra
@@ -260,6 +264,7 @@ runtime/syntax/pascal.vim @dkearns
runtime/syntax/pbtxt.vim @lakshayg
runtime/syntax/pdf.vim @tpope
runtime/syntax/php.vim @TysonAndre
runtime/syntax/postscr.vim @mrdubya
runtime/syntax/privoxy.vim @dkearns
runtime/syntax/prolog.vim @XVilka
runtime/syntax/ps1.vim @heaths
@@ -267,6 +272,7 @@ runtime/syntax/ps1xml.vim @heaths
runtime/syntax/psl.vim @danielkho
runtime/syntax/qb64.vim @dkearns
runtime/syntax/rc.vim @chrisbra
runtime/syntax/rebol.vim @mrdubya
runtime/syntax/routeros.vim @zainin
runtime/syntax/rpcgen.vim @cecamp
runtime/syntax/ruby.vim @dkearns
@@ -306,4 +312,5 @@ src/libvterm/ @leonerd
src/po/de.po @chrisbra
src/po/eo.po @dpelle
src/po/fr.po @dpelle
src/po/ga.po @kscanne
src/xxd/ @jnweiger
+4 -4
View File
@@ -37,11 +37,11 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -52,7 +52,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v2
# ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
@@ -66,4 +66,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
+1 -1
View File
@@ -13,7 +13,7 @@ jobs:
DEBIAN_FRONTEND: noninteractive
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Download Coverity
run: |
+20 -13
View File
@@ -1,14 +1,18 @@
README.txt for color scheme files
These files are used for the ":colorscheme" command. They appear in the
These files are used for the `:colorscheme` command. They appear in the
"Edit/Color Scheme" menu in the GUI.
The colorschemes were updated for the Vim 9 release. If you don't like the
changes you can find the old ones here:
https://github.com/vim/colorschemes/tree/master/legacy_colors
Hints for writing a color scheme file:
There are two basic ways to define a color scheme:
1. Define a new Normal color and set the 'background' option accordingly.
1. Define a new Normal color and set the 'background' option accordingly. >
set background={light or dark}
highlight clear
@@ -16,7 +20,7 @@ There are two basic ways to define a color scheme:
...
2. Use the default Normal color and automatically adjust to the value of
'background'.
'background'. >
highlight clear Normal
set background&
@@ -29,17 +33,17 @@ There are two basic ways to define a color scheme:
...
endif
You can use ":highlight clear" to reset everything to the defaults, and then
You can use `:highlight clear` to reset everything to the defaults, and then
change the groups that you want differently. This will also work for groups
that are added in later versions of Vim.
Note that ":highlight clear" uses the value of 'background', thus set it
Note that `:highlight clear` uses the value of 'background', thus set it
before this command.
Some attributes (e.g., bold) might be set in the defaults that you want
removed in your color scheme. Use something like "gui=NONE" to remove the
attributes.
In case you want to set 'background' depending on the colorscheme selected,
this autocmd might be useful:
this autocmd might be useful: >
autocmd SourcePre */colors/blue_sky.vim set background=dark
@@ -49,7 +53,7 @@ In case you want to tweak a colorscheme after it was loaded, check out the
ColorScheme autocommand event.
To clean up just before loading another colorscheme, use the ColorSchemePre
autocommand event. For example:
autocommand event. For example: >
let g:term_ansi_colors = ...
augroup MyColorscheme
@@ -59,20 +63,20 @@ autocommand event. For example:
augroup END
To customize a colorscheme use another name, e.g. "~/.vim/colors/mine.vim",
and use ":runtime" to load the original colorscheme:
and use ":runtime" to load the original colorscheme: >
" load the "evening" colorscheme
runtime colors/evening.vim
" change the color of statements
hi Statement ctermfg=Blue guifg=Blue
To see which highlight group is used where, see ":help highlight-groups" and
":help group-name".
To see which highlight group is used where, see `:help highlight-groups` and
`:help group-name` .
You can use ":highlight" to find out the current colors. Exception: the
ctermfg and ctermbg values are numbers, which are only valid for the current
terminal. Use the color names instead for better portability. See
":help cterm-colors".
`:help cterm-colors` .
The default color settings can be found in the source file src/syntax.c.
Search for "highlight_init".
@@ -86,7 +90,7 @@ please check the following items:
- Does it work in a color terminal as well as in the GUI? Is it consistent?
- Is "g:colors_name" set to a meaningful value? In case of doubt you can do
it this way:
it this way: >
let g:colors_name = expand('<sfile>:t:r')
@@ -121,7 +125,7 @@ please check the following items:
- Try to keep your color scheme simple by avoiding unnecessary logic and
refraining from adding options. The best color scheme is one that only
requires:
requires: >
colorscheme foobar
@@ -136,3 +140,6 @@ that:
- it was made with colortemplate,
and join us at vim/colorschemes: (https://github.com/vim/colorschemes).
vim: set ft=help :
+18 -18
View File
@@ -1401,7 +1401,7 @@ changenr() *changenr()*
one less than the number of the undone change.
char2nr({string} [, {utf8}]) *char2nr()*
Return number value of the first char in {string}.
Return Number value of the first char in {string}.
Examples: >
char2nr(" ") returns 32
char2nr("ABC") returns 65
@@ -1500,8 +1500,7 @@ cindent({lnum}) *cindent()*
indenting rules, as with 'cindent'.
The indent is counted in spaces, the value of 'tabstop' is
relevant. {lnum} is used just like in |getline()|.
When {lnum} is invalid or Vim was not compiled the |+cindent|
feature, -1 is returned.
When {lnum} is invalid -1 is returned.
See |C-indenting|.
Can also be used as a |method|: >
@@ -1712,13 +1711,13 @@ confirm({msg} [, {choices} [, {default} [, {type}]]])
An example: >
let choice = confirm("What do you want?",
\ "&Apples\n&Oranges\n&Bananas", 2)
\ "&Apples\n&Oranges\n&Bananas", 2)
if choice == 0
echo "make up your mind!"
echo "make up your mind!"
elseif choice == 3
echo "tasteful"
echo "tasteful"
else
echo "I prefer bananas myself."
echo "I prefer bananas myself."
endif
< In a GUI dialog, buttons are used. The layout of the buttons
depends on the 'v' flag in 'guioptions'. If it is included,
@@ -2306,8 +2305,8 @@ exists({expr}) The result is a Number, which is |TRUE| if {expr} is defined,
< There must be no space between the symbol (&/$/*/#) and the
name.
There must be no extra characters after the name, although in
a few cases this is ignored. That may become more strict in
the future, thus don't count on it!
a few cases this is ignored. That may become stricter in the
future, thus don't count on it!
Working example: >
exists(":make")
< NOT working example: >
@@ -3219,7 +3218,7 @@ getchar([expr]) *getchar()*
Without [expr] and when [expr] is 0 a whole character or
special key is returned. If it is a single character, the
result is a number. Use nr2char() to convert it to a String.
result is a Number. Use |nr2char()| to convert it to a String.
Otherwise a String is returned with the encoded character.
For a special key it's a String with a sequence of bytes
starting with 0x80 (decimal: 128). This is the same value as
@@ -5173,8 +5172,7 @@ lispindent({lnum}) *lispindent()*
indenting rules, as with 'lisp'.
The indent is counted in spaces, the value of 'tabstop' is
relevant. {lnum} is used just like in |getline()|.
When {lnum} is invalid or Vim was not compiled the
|+lispindent| feature, -1 is returned. In |Vim9| script an
When {lnum} is invalid -1 is returned. In |Vim9| script an
error is given.
Can also be used as a |method|: >
@@ -5468,7 +5466,7 @@ maparg({name} [, {mode} [, {abbr} [, {dict}]]]) *maparg()*
"sid" The script local ID, used for <sid> mappings
(|<SID>|).
"scriptversion" The version of the script. 999999 for
|Vim9| script.
|Vim9| script.
"lnum" The line number in "sid", zero if unknown.
"nowait" Do not wait for other, longer mappings.
(|:map-<nowait>|).
@@ -5573,7 +5571,7 @@ mapset({dict})
Restore a mapping from a dictionary, possibly returned by
|maparg()| or |maplist()|. A buffer mapping, when dict.buffer
is true, is set on the current buffer; it is up to the caller
to insure that the intended buffer is the current buffer. This
to ensure that the intended buffer is the current buffer. This
feature allows copying mappings from one buffer to another.
The dict.mode value may restore a single mapping that covers
more than one mode, like with mode values of '!', ' ', 'nox',
@@ -8324,7 +8322,7 @@ sort({list} [, {how} [, {dict}]]) *sort()* *E702*
If you want a list to remain unmodified make a copy first: >
:let sortedlist = sort(copy(mylist))
< When {how} is omitted or is an string, then sort() uses the
< When {how} is omitted or is a string, then sort() uses the
string representation of each item to sort on. Numbers sort
after Strings, |Lists| after Numbers. For sorting text in the
current buffer use |:sort|.
@@ -8779,9 +8777,11 @@ strftime({format} [, {time}]) *strftime()*
GetFormat()->strftime()
strgetchar({str}, {index}) *strgetchar()*
Get character {index} from {str}. This uses a character
index, not a byte index. Composing characters are considered
separate characters here.
Get a Number corresponding to the character at {index} in
{str}. This uses a zero-based character index, not a byte
index. Composing characters are considered separate
characters here. Use |nr2char()| to convert the Number to a
String.
Also see |strcharpart()| and |strchars()|.
Can also be used as a |method|: >
-3
View File
@@ -22,9 +22,6 @@ indent and do not perform other formatting. There are additional options that
affect other kinds of formatting as well as indenting, see |format-comments|,
|fo-table|, |gq| and |formatting| for the main ones.
Note that this will not work when the |+smartindent| or |+cindent| features
have been disabled at compile time.
There are in fact four main methods available for indentation, each one
overrides the previous if it is enabled, or non-empty for 'indentexpr':
'autoindent' uses the indent from the previous line.
+2 -1
View File
@@ -1,4 +1,4 @@
*map.txt* For Vim version 8.2. Last change: 2022 May 09
*map.txt* For Vim version 8.2. Last change: 2022 May 16
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -701,6 +701,7 @@ not to be matched with any key sequence. This is useful in plugins
*<MouseMove>*
The special key name "<MouseMove>" can be used to handle mouse movement. It
needs to be enabled with 'mousemoveevent'. Currently only works in the GUI.
The |getmousepos()| function can be used to obtain the mouse position.
*<Char>* *<Char->*
To map a character by its decimal, octal or hexadecimal number the <Char>
+2 -20
View File
@@ -1626,8 +1626,6 @@ A jump table for the options with a short description can be found at |Q_op|.
*'cindent'* *'cin'* *'nocindent'* *'nocin'*
'cindent' 'cin' boolean (default off)
local to buffer
{not available when compiled without the |+cindent|
feature}
Enables automatic C program indenting. See 'cinkeys' to set the keys
that trigger reindenting in insert mode and 'cinoptions' to set your
preferred indent style.
@@ -1644,8 +1642,6 @@ A jump table for the options with a short description can be found at |Q_op|.
*'cinkeys'* *'cink'*
'cinkeys' 'cink' string (default "0{,0},0),0],:,0#,!^F,o,O,e")
local to buffer
{not available when compiled without the |+cindent|
feature}
A list of keys that, when typed in Insert mode, cause reindenting of
the current line. Only used if 'cindent' is on and 'indentexpr' is
empty.
@@ -1655,8 +1651,6 @@ A jump table for the options with a short description can be found at |Q_op|.
*'cinoptions'* *'cino'*
'cinoptions' 'cino' string (default "")
local to buffer
{not available when compiled without the |+cindent|
feature}
The 'cinoptions' affect the way 'cindent' reindents lines in a C
program. See |cinoptions-values| for the values of this option, and
|C-indenting| for info on C indenting in general.
@@ -1665,8 +1659,6 @@ A jump table for the options with a short description can be found at |Q_op|.
*'cinwords'* *'cinw'*
'cinwords' 'cinw' string (default "if,else,while,do,for,switch")
local to buffer
{not available when compiled without both the
|+cindent| and the |+smartindent| features}
These keywords start an extra indent in the next line when
'smartindent' or 'cindent' is set. For 'cindent' this is only done at
an appropriate place (inside {}).
@@ -1677,8 +1669,6 @@ A jump table for the options with a short description can be found at |Q_op|.
*'cinscopedecls'* *'cinsd'*
'cinscopedecls' 'cinsd' string (default "public,protected,private")
local to buffer
{not available when compiled without the |+cindent|
feature}
Keywords that are interpreted as a C++ scope declaration by |cino-g|.
Useful e.g. for working with the Qt framework that defines additional
scope declarations "signals", "public slots" and "private slots": >
@@ -4673,8 +4663,8 @@ A jump table for the options with a short description can be found at |Q_op|.
*'indentexpr'* *'inde'*
'indentexpr' 'inde' string (default "")
local to buffer
{not available when compiled without the |+cindent|
or |+eval| features}
{not available when compiled without the |+eval|
feature}
Expression which is evaluated to obtain the proper indent for a line.
It is used when a new line is created, for the |=| operator and
in Insert mode as specified with the 'indentkeys' option.
@@ -4719,8 +4709,6 @@ A jump table for the options with a short description can be found at |Q_op|.
*'indentkeys'* *'indk'*
'indentkeys' 'indk' string (default "0{,0},0),0],:,0#,!^F,o,O,e")
local to buffer
{not available when compiled without the |+cindent|
feature}
A list of keys that, when typed in Insert mode, cause reindenting of
the current line. Only happens if 'indentexpr' isn't empty.
The format is identical to 'cinkeys', see |indentkeys-format|.
@@ -5108,8 +5096,6 @@ A jump table for the options with a short description can be found at |Q_op|.
*'lisp'* *'nolisp'*
'lisp' boolean (default off)
local to buffer
{not available when compiled without the |+lispindent|
feature}
Lisp mode: When <Enter> is typed in insert mode set the indent for
the next line to Lisp standards (well, sort of). Also happens with
"cc" or "S". 'autoindent' must also be on for this to work. The 'p'
@@ -5123,8 +5109,6 @@ A jump table for the options with a short description can be found at |Q_op|.
*'lispwords'* *'lw'*
'lispwords' 'lw' string (default is very long)
global or local to buffer |global-local|
{not available when compiled without the |+lispindent|
feature}
Comma-separated list of words that influence the Lisp indenting.
|'lisp'|
@@ -7354,8 +7338,6 @@ A jump table for the options with a short description can be found at |Q_op|.
*'smartindent'* *'si'* *'nosmartindent'* *'nosi'*
'smartindent' 'si' boolean (default off)
local to buffer
{not available when compiled without the
|+smartindent| feature}
Do smart autoindenting when starting a new line. Works for C-like
programs, but can also be used for other languages. 'cindent' does
something like this, works better in most cases, but is more strict,
+77 -50
View File
@@ -1,4 +1,4 @@
*syntax.txt* For Vim version 8.2. Last change: 2022 May 06
*syntax.txt* For Vim version 8.2. Last change: 2022 May 20
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -32,13 +32,14 @@ In the User Manual:
10. Including syntax files |:syn-include|
11. Synchronizing |:syn-sync|
12. Listing syntax items |:syntax|
13. Highlight command |:highlight|
14. Linking groups |:highlight-link|
15. Cleaning up |:syn-clear|
16. Highlighting tags |tag-highlight|
17. Window-local syntax |:ownsyntax|
18. Color xterms |xterm-color|
19. When syntax is slow |:syntime|
13. Colorschemes |color-schemes|
14. Highlight command |:highlight|
15. Linking groups |:highlight-link|
16. Cleaning up |:syn-clear|
17. Highlighting tags |tag-highlight|
18. Window-local syntax |:ownsyntax|
19. Color xterms |xterm-color|
20. When syntax is slow |:syntime|
{Vi does not have any of these commands}
@@ -1511,7 +1512,7 @@ modes Conditional, Number, Statement, Comment, PreProc, Type, and String,
following the language specifications in 'Symbolic Manipulation with FORM' by
J.A.M. Vermaseren, CAN, Netherlands, 1991.
If you want include your own changes to the default colors, you have to
If you want to include your own changes to the default colors, you have to
redefine the following syntax groups:
- formConditional
@@ -4845,20 +4846,14 @@ Note that the ":syntax" command can be abbreviated to ":sy", although ":syn"
is mostly used, because it looks better.
==============================================================================
13. Highlight command *:highlight* *:hi* *E28* *E411* *E415*
There are three types of highlight groups:
- The ones used for specific languages. For these the name starts with the
name of the language. Many of these don't have any attributes, but are
linked to a group of the second type.
- The ones used for all syntax languages.
- The ones used for the 'highlight' option.
*hitest.vim*
You can see all the groups currently active with this command: >
:so $VIMRUNTIME/syntax/hitest.vim
This will open a new window containing all highlight group names, displayed
in their own color.
13. Colorschemes *color-schemes*
In the next section you can find information about indivisual highlight groups
and how to specify colors for them. Most likely you want to just select a set
of colors by using the `:colorscheme` command, for example: >
colorscheme pablo
<
*:colo* *:colorscheme* *E185*
:colo[rscheme] Output the name of the currently active color scheme.
This is basically the same as >
@@ -4876,30 +4871,62 @@ in their own color.
Doesn't work recursively, thus you can't use
":colorscheme" in a color scheme script.
You have two options for customizing a color scheme.
For changing the appearance of specific colors, you
can redefine a color name before loading the scheme.
The desert scheme uses the khaki color for the cursor.
To use a darker variation of the same color: >
You have two options for customizing a color scheme. For changing the
appearance of specific colors, you can redefine a color name before loading
the scheme. The desert scheme uses the khaki color for the cursor. To use a
darker variation of the same color: >
let v:colornames['khaki'] = '#bdb76b'
colorscheme desert
let v:colornames['khaki'] = '#bdb76b'
colorscheme desert
<
For further customization, such as changing
|:highlight-link| associations, use another name, e.g.
"~/.vim/colors/mine.vim", and use `:runtime` to load
the original color scheme: >
runtime colors/evening.vim
hi Statement ctermfg=Blue guifg=Blue
For further customization, such as changing |:highlight-link| associations,
use another name, e.g. "~/.vim/colors/mine.vim", and use `:runtime` to load
the original color scheme: >
runtime colors/evening.vim
hi Statement ctermfg=Blue guifg=Blue
< Before the color scheme will be loaded all default
color list scripts (`colors/lists/default.vim`) will
be executed and then the |ColorSchemePre| autocommand
event is triggered. After the color scheme has been
loaded the |ColorScheme| autocommand event is
triggered.
For info about writing a color scheme file: >
:edit $VIMRUNTIME/colors/README.txt
Before the color scheme will be loaded all default color list scripts
(`colors/lists/default.vim`) will be executed and then the |ColorSchemePre|
autocommand event is triggered. After the color scheme has been loaded the
|ColorScheme| autocommand event is triggered.
If a color scheme is almost right, you can add modifications on top of it by
using the |ColorScheme| autocommand. For example, to remove the background
color (can make it transparent in some terminals): >
augroup my_colorschemes
au!
au Colorscheme pablo hi Normal ctermbg=NONE
augroup END
If you make a lot of changes it might be better to copy the distributed
colorscheme to your home directory and change it: >
:!cp $VIMRUNTIME/colors/pablo.vim ~/.vim/colors
:edit ~/.vim/colors/pablo.vim
With Vim 9.0 the collection of color schemes was updated and made work in many
different terminals. One change was to often define the Normal highlight
group to make sure the colors work well. In case you prefer the old version,
you can find them here:
https://github.com/vim/colorschemes/blob/master/legacy_colors/
For info about writing a color scheme file: >
:edit $VIMRUNTIME/colors/README.txt
==============================================================================
14. Highlight command *:highlight* *:hi* *E28* *E411* *E415*
There are three types of highlight groups:
- The ones used for specific languages. For these the name starts with the
name of the language. Many of these don't have any attributes, but are
linked to a group of the second type.
- The ones used for all syntax languages.
- The ones used for the 'highlight' option.
*hitest.vim*
You can see all the groups currently active with this command: >
:so $VIMRUNTIME/syntax/hitest.vim
This will open a new window containing all highlight group names, displayed
in their own color.
:hi[ghlight] List all the current highlight groups that have
attributes set.
@@ -5206,7 +5233,7 @@ guisp={color-name} *highlight-guisp*
All values are hexadecimal, range from "00" to "ff". Examples: >
:highlight Comment guifg=#11f0c3 guibg=#ff00ff
<
If you are authoring a color scheme and use the same hexademical value
If you are authoring a color scheme and use the same hexadecimal value
repeatedly, you can define a name for it in |v:colornames|. For
example: >
@@ -5416,7 +5443,7 @@ Tooltip Current font, background and foreground of the tooltips.
set.
==============================================================================
14. Linking groups *:hi-link* *:highlight-link* *E412* *E413*
15. Linking groups *:hi-link* *:highlight-link* *E412* *E413*
When you want to use the same highlighting for several syntax groups, you
can do this more easily by linking the groups into one common highlight
@@ -5460,7 +5487,7 @@ another color scheme, put a command like this in the
highlight! default link cComment Question
==============================================================================
15. Cleaning up *:syn-clear* *E391*
16. Cleaning up *:syn-clear* *E391*
If you want to clear the syntax stuff for the current buffer, you can use this
command: >
@@ -5552,7 +5579,7 @@ syntax/syncolor.vim files are loaded:
them.
==============================================================================
16. Highlighting tags *tag-highlight*
17. Highlighting tags *tag-highlight*
If you want to highlight all the tags in your file, you can use the following
mappings.
@@ -5588,7 +5615,7 @@ And put these lines in your .vimrc: >
autocmd BufRead,BufNewFile *.[ch] endif
==============================================================================
17. Window-local syntax *:ownsyntax*
18. Window-local syntax *:ownsyntax*
Normally all windows on a buffer share the same syntax settings. It is
possible, however, to set a particular window on a file to have its own
@@ -5618,7 +5645,7 @@ is loaded into that window or the file is reloaded.
When splitting the window, the new window will use the original syntax.
==============================================================================
18. Color xterms *xterm-color* *color-xterm*
19. Color xterms *xterm-color* *color-xterm*
Most color xterms have only eight colors. If you don't get colors with the
default setup, it should work with these lines in your .vimrc: >
@@ -5762,7 +5789,7 @@ that Setup / Font / Enable Bold is NOT enabled.
==============================================================================
19. When syntax is slow *:syntime*
20. When syntax is slow *:syntime*
This is aimed at authors of a syntax file.
+6
View File
@@ -4321,6 +4321,7 @@ E1274 cmdline.txt /*E1274*
E1276 builtin.txt /*E1276*
E1278 eval.txt /*E1278*
E128 eval.txt /*E128*
E1281 pattern.txt /*E1281*
E129 eval.txt /*E129*
E13 message.txt /*E13*
E131 eval.txt /*E131*
@@ -5863,6 +5864,7 @@ autocmd-events autocmd.txt /*autocmd-events*
autocmd-events-abc autocmd.txt /*autocmd-events-abc*
autocmd-execute autocmd.txt /*autocmd-execute*
autocmd-expand autocmd.txt /*autocmd-expand*
autocmd-functions usr_41.txt /*autocmd-functions*
autocmd-groups autocmd.txt /*autocmd-groups*
autocmd-intro autocmd.txt /*autocmd-intro*
autocmd-list autocmd.txt /*autocmd-list*
@@ -5874,6 +5876,9 @@ autocmd-remove autocmd.txt /*autocmd-remove*
autocmd-searchpat autocmd.txt /*autocmd-searchpat*
autocmd-use autocmd.txt /*autocmd-use*
autocmd.txt autocmd.txt /*autocmd.txt*
autocmd_add() builtin.txt /*autocmd_add()*
autocmd_delete() builtin.txt /*autocmd_delete()*
autocmd_get() builtin.txt /*autocmd_get()*
autocmds-kept version5.txt /*autocmds-kept*
autocommand autocmd.txt /*autocommand*
autocommand-events autocmd.txt /*autocommand-events*
@@ -6277,6 +6282,7 @@ col() builtin.txt /*col()*
coldfusion.vim syntax.txt /*coldfusion.vim*
collapse tips.txt /*collapse*
collate-variable eval.txt /*collate-variable*
color-schemes syntax.txt /*color-schemes*
color-xterm syntax.txt /*color-xterm*
coloring syntax.txt /*coloring*
colortest.vim syntax.txt /*colortest.vim*
+1 -1
View File
@@ -1,4 +1,4 @@
*testing.txt* For Vim version 8.2. Last change: 2022 Apr 03
*testing.txt* For Vim version 8.2. Last change: 2022 May 16
VIM REFERENCE MANUAL by Bram Moolenaar
+33 -40
View File
@@ -1,4 +1,4 @@
*todo.txt* For Vim version 8.2. Last change: 2022 May 14
*todo.txt* For Vim version 8.2. Last change: 2022 May 21
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -38,6 +38,9 @@ browser use: https://github.com/vim/vim/issues/1234
*known-bugs*
-------------------- Known bugs and current work -----------------------
Make :defcompile accept a function argument, like :disassemble
Useful for global functions.
Once Vim9 is stable:
- Use Vim9 for more runtime files.
- Check code coverage, add more tests if needed.
@@ -50,9 +53,10 @@ Once Vim9 is stable:
Graduate FEAT_CINDENT and FEAT_SMARTINDENT ?
Update the user manual:
- Move most of usr_52.txt into usr_41.txt
- Make usr_41.txt only about basic script writing
- Update usr_41.txt for Vim9 script
- Fill usr_50.txt as an "advanced section" of usr_41.txt
Add links from usr_41 to usr_50.
- Make usr_51.txt use Vim9 script. Still need usr_52.txt?
Further Vim9 improvements, possibly after launch:
@@ -130,14 +134,13 @@ Text properties:
where property fits in.
Or Should we let the textprop highlight overrule other (e.g. diff) highlight
if the priority is above a certain value? (#7392)
Combining text property with 'cursorline' does not always work (Billie
Cleek, #5533)
- "C" works OK. "dd" fails to delete text property in a buffer with a single
line.
- Add text property that shifts text to make room for annotation (e.g.
variable type). Like the opposite of conceal. Requires fixing the cursor
positioning and mouse clicks as with conceal mode.
- Auto-indenting may cause highlighting to shift. (#7719)
- Combining text property with 'cursorline' does not always work (Billie
Cleek, #5533)
- See remarks at top of src/textprop.c
'incsearch' with :s:
@@ -659,9 +662,6 @@ that Vim doesn't find the edited file in the buffer list, causing the
ATTENTION message? (Tony Mechelynck, 2008 Dec 1)
Also: swap files are in ~/tmp/ One has relative file name ".mozilla/...".
'foldcolumn' in modeline applied to wrong window when using a session. (Teemu
Likonen, March 19)
When using a timer callback vgetc_busy is reset, allowing for using input().
But in a channel callback this does not happen. We need to do something
similar to check_due_timer(). Also see #3809.
@@ -886,9 +886,6 @@ word is re-added to it. (Matej Cepl, 2018 Feb 6)
Fold at end of the buffer behaves inconsistently. (James McCoy, 2017 Oct 9)
With foldmethod=syntax and nofoldenable comment highlighting isn't removed.
(Marcin Szewczyk, 2017 Apr 26)
Using 'wildignore' also applies to literally entered file name. Also with
:drop (remote commands).
@@ -1002,8 +999,6 @@ After using :noautocmd CursorMoved may still trigger. (Andy Stewart, 2017 Sep
When bracketed paste is used, pasting at the ":append" prompt does not get the
line breaks. (Ken Takata, 2017 Aug 22)
The ":move" command does not honor closed folds. (Ryan Lue, #2351)
Cannot copy modeless selection when cursor is inside it. (lkintact, #2300)
Test_writefile_fails_conversion failure on Solaris because if different iconv
@@ -1534,11 +1529,6 @@ was already defined.
Patch for ordered dict. (Ozaki Kiichi, 2015 May 7)
Patch to make closed folds line up. (Charles Campbell, 2014 Sep 12)
Remark from Roland Eggner: does it cause crashes? (2014 Dec 12)
Updated patch by Roland Eggner, Dec 16
Updated patch from Charles, 2016 Jul 2
Patch for building a 32bit Vim with 64bit MingW compiler.
(Michael Soyka, 2014 Oct 15)
@@ -1714,8 +1704,6 @@ Patch to support 'u' in interactive substitute. (Christian Brabandt, 2012 Sep
Dialog is too big on Linux too. (David Fishburn, 2013 Sep 2)
Patch to make fold updates much faster. (Christian Brabandt, 2012 Dec)
- Add regex for 'paragraphs' and 'sections': 'parare' and 'sectre'. Combine
the two into a regex for searching. (Ned Konz)
Patch by Christian Brabandt, 2013 Apr 20, unfinished.
@@ -1779,10 +1767,6 @@ URXVT:
- Use urxvt mouse support also in xterm. Explanations:
http://www.midnight-commander.org/ticket/2662
Patch to have the fold and sign column and at the last line of the buffer.
(Marco Hinz, 2014 Sep 25)
Alternate suggestion: let all columns continue, also the number column.
Patch to add tests for if_xcmdsrv.c., Jul 8, need some more work. (Brian Burns)
New tests Jul 13. Update Jul 17. Discussion Jul 18.
@@ -1983,9 +1967,6 @@ the command line. (Ingo Karkat, 2011 Jan 25)
Since patch 7.2.46 Yankring plugin has become very slow, eventually make Vim
crash? (Raiwil, 2010 Nov 17)
Patch to add FoldedLineNr highlighting: different highlighting for the line
number of a closed fold. (eXerigumo Clanjor, 2013 Jul 15)
Regexp engine performance:
- Profiling:
./vim -u NONE -s ~/vim/test/ruby.vim
@@ -2097,9 +2078,6 @@ like it has ":keepjumps" before it.
Coverity: Check if there are new reported defects:
https://scan.coverity.com/projects/241
Patch to use 'foldnestmax' also for "marker" foldmethod. (Arnaud Lacombe, 2011
Jan 7)
Problem with editing file in binary mode. (Ingo Krabbe, 2009 Oct 8)
Display error when 'tabline' that includes a file name with double-width
@@ -2112,9 +2090,6 @@ Using ']' as the end of a range in a pattern requires double escaping:
Syntax priority problem. (Charles Campbell, 2011 Sep 15)
When completion inserts the first match, it may trigger the line to be folded.
Disable updating folds while completion is active? (Peter Odding, 2010 Jun 9)
For running gvim on a USB stick: avoid the OLE registration. Use a command
line argument -noregister.
@@ -2189,10 +2164,6 @@ Don't load macmap.vim on startup, turn it into a plugin. (Ron Aaron,
Add "no_hlsearch" to winsaveview().
When 'foldmethod' is "indent", adding an empty line below a fold and then
indented text, creates a new fold instead of joining it with the previous one.
(Evan Laforge, 2009 Oct 17)
Bug: When reloading a buffer changed outside of Vim, BufRead autocommands
are applied to the wrong buffer/window. (Ben Fritz, 2009 Apr 2, May 11)
Ignore window options when not in the right window?
@@ -2412,8 +2383,6 @@ Problem with 'ts' set to 9 and 'showbreak' to ">>>". (Matthew Winn, 2007 Oct
":tab help" always opens a new tab, while ":help" re-uses an existing window.
Would be more consistent when an existing tab is re-used. (Tony Mechelynck)
Add ":nofold". Range will apply without expanding to closed fold.
Using Aap to build Vim: add remarks about how to set personal preferences.
Example on http://www.calmar.ws/tmp/aap.html
@@ -3809,6 +3778,30 @@ Diff mode:
Folding:
(commands still available: zI zJ zK zp zP zq zQ zV zy zY;
secondary: zB zS zT zZ, z=)
- Patch to make closed folds line up. (Charles Campbell, 2014 Sep 12)
Remark from Roland Eggner: does it cause crashes? (2014 Dec 12)
Updated patch by Roland Eggner, Dec 16
Updated patch from Charles, 2016 Jul 2
- Patch to make fold updates much faster. (Christian Brabandt, 2012 Dec)
- Patch to have the fold and sign column and at the last line of the buffer.
(Marco Hinz, 2014 Sep 25)
Alternate suggestion: let all columns continue, also the number column.
- Patch to add FoldedLineNr highlighting: different highlighting for the
line number of a closed fold. (eXerigumo Clanjor, 2013 Jul 15)
- Patch to use 'foldnestmax' also for "marker" foldmethod. (Arnaud Lacombe,
2011 Jan 7)
- 'foldcolumn' in modeline applied to wrong window when using a session.
(Teemu Likonen, March 19)
- With foldmethod=syntax and nofoldenable comment highlighting isn't
removed. (Marcin Szewczyk, 2017 Apr 26)
- The ":move" command does not honor closed folds. (Ryan Lue, #2351)
- When completion inserts the first match, it may trigger the line to be
folded. Disable updating folds while completion is active? (Peter Odding,
2010 Jun 9)
- When 'foldmethod' is "indent", adding an empty line below a fold and then
indented text, creates a new fold instead of joining it with the previous
one. (Evan Laforge, 2009 Oct 17)
- Add ":nofold". Range will apply without expanding to closed fold.
8 Vertical folds: looks like vertically split windows, but the cursor moves
through the vertical separator, separator moves when scrolling.
8 Add "z/" and "z?" for searching in not folded text only. Or use a regexp
+3 -1
View File
@@ -1,4 +1,4 @@
*usr_41.txt* For Vim version 8.2. Last change: 2022 May 13
*usr_41.txt* For Vim version 8.2. Last change: 2022 May 21
VIM USER MANUAL - by Bram Moolenaar
@@ -1923,6 +1923,8 @@ are script-local.
If you split your plugin into parts, you can use `import` and `export` to
share items between those parts. See `:export` for the details.
More information about writing plugins is in |usr_51.txt|.
==============================================================================
Next chapter: |usr_42.txt| Add new menus
+3 -3
View File
@@ -1,4 +1,4 @@
*usr_51.txt* For Vim version 8.2. Last change: 2022 May 13
*usr_51.txt* For Vim version 8.2. Last change: 2022 May 14
VIM USER MANUAL - by Bram Moolenaar
@@ -197,8 +197,8 @@ would need to prefix the name with "s:".
We will define a function that adds a new typing correction: >
30 def Add(from: string, correct: bool)
31 var to = input("type the correction for " .. from .. ": ")
32 exe ":iabbrev " .. from .. " " .. to
31 var to = input($"type the correction for {from}: ")
32 exe $":iabbrev {from} {to}"
..
36 enddef
+12 -8
View File
@@ -1,4 +1,4 @@
*usr_52.txt* For Vim version 8.2. Last change: 2022 May 13
*usr_52.txt* For Vim version 8.2. Last change: 2022 May 16
VIM USER MANUAL - by Bram Moolenaar
@@ -110,10 +110,10 @@ Although it's shorter to do: >
==============================================================================
*52.3* Functions and types
Legacy Vim script does have type checking, but this happens at runtime, when
the code is executed. And it's permissive, often a computation gives an
unexpected value instead of reporting an error. Thus you can define a
function and think it's fine, but see a problem only later when it is called: >
Legacy Vim script only checks types at runtime, when the code is executed.
And it's permissive, often a computation gives an unexpected value instead of
reporting an error. Thus you can define a function and think it's fine, but
see a problem only later when it is called: >
let s:collected = ''
func ExtendAndReturn(add)
let s:collected += a:add
@@ -133,12 +133,16 @@ the argument is used without the "a:" prefix: >
s:collected += add
return s:collected
enddef
defcompile
disassemble ExtendAndReturn
Here we use `:defcompile` to do the compilation right away, without it the
Here we use `:disassemble` to do the compilation right away, without it the
compilation would happen when the function is called. Vim will tell you what
you did wrong: >
E1013: type mismatch, expected number but got string
E1051: Wrong argument type for +
Side note: here the context is legacy script, when using Vim9 script you would
put `:defcompile` at the end of the script to check for errors in the
functions defined in it.
Vim9 script is strict, it uses the "+" operator only for numbers and floats.
For string concatenation ".." must be used. This avoids mistakes and avoids
+3 -3
View File
@@ -346,7 +346,7 @@ B *++builtin_terms* maximal terminals builtin |builtin-terms|
N *+byte_offset* support for 'o' flag in 'statusline' option, "go"
and ":goto" commands.
m *+channel* inter process communication |channel|
N *+cindent* |'cindent'|, C indenting
6 *+cindent* |'cindent'|, C indenting
N *+clientserver* Unix and Win32: Remote invocation |clientserver|
*+clipboard* |clipboard| support compiled-in
*+clipboard_working* |clipboard| support compiled-in and working
@@ -399,7 +399,7 @@ N *+lambda* |lambda| and |closure|
B *+langmap* |'langmap'|
N *+libcall* |libcall()|
N *+linebreak* |'linebreak'|, |'breakat'| and |'showbreak'|
N *+lispindent* |'lisp'|
t *+lispindent* |'lisp'|
T *+listcmds* Vim commands for the list of buffers |buffer-hidden|
and argument list |:argdelete|
T *+localmap* Support for mappings local to a buffer |:map-local|
@@ -452,7 +452,7 @@ m *+ruby* Ruby interface |ruby|
m *+ruby/dyn* Ruby interface |ruby-dynamic| |/dyn|
T *+scrollbind* |'scrollbind'|
B *+signs* |:sign|
N *+smartindent* |'smartindent'|
t *+smartindent* |'smartindent'|
B *+sodium* compiled with libsodium for better encryption support
B *+sound* |sound_playevent()|, |sound_playfile()| functions, etc.
N *+spell* spell checking support, see |spell|
+8 -1
View File
@@ -1210,7 +1210,14 @@ prefix if they do not exist at the time of compiling.
*:defc* *:defcompile*
:defc[ompile] Compile functions defined in the current script that
were not compiled yet.
This will report errors found during the compilation.
This will report any errors found during compilation.
:defc[ompile] {func}
:defc[ompile] debug {func}
:defc[ompile] profile {func}
Compile function {func}, if needed. Use "debug" and
"profile" to specify the compilation mode.
This will report any errors found during compilation.
*:disa* *:disassemble*
:disa[ssemble] {func} Show the instructions generated for {func}.
+3 -2
View File
@@ -3,6 +3,7 @@
" Maintainer: Igor Gnatenko i.gnatenko.brain@gmail.com
" Former Maintainer: Gustavo Niemeyer <niemeyer@conectiva.com> (until March 2014)
" Last Change: Mon Jun 01 21:15 MSK 2015 Igor Gnatenko
" Update by Zdenek Dohnal, 2022 May 17
if exists("b:did_ftplugin")
finish
@@ -41,8 +42,8 @@ else:
headers = spec.sourceHeader
version = headers["Version"]
release = headers["Release"]
vim.command("let ver = " + version)
vim.command("let rel = " + release)
vim.command("let ver = '" + version + "'")
vim.command("let rel = '" + release + "'")
PYEND
endif
endfunction
+4 -1
View File
@@ -5,6 +5,7 @@
Name[ca]=GVim
Name[de]=GVim
Name[eo]=GVim
Name[es]=GVim
Name[fi]=GVim
Name[fr]=GVim
Name[ga]=GVim
@@ -18,6 +19,7 @@ Name=GVim
GenericName[ca]=Editor de text
GenericName[de]=Texteditor
GenericName[eo]=Tekstoredaktilo
GenericName[es]=Editor de texto
GenericName[fi]=Tekstinmuokkain
GenericName[fr]=Éditeur de texte
GenericName[ga]=Eagarthóir Téacs
@@ -32,6 +34,7 @@ GenericName=Text Editor
Comment[ca]=Edita fitxers de text
Comment[de]=Textdateien bearbeiten
Comment[eo]=Redakti tekstajn dosierojn
Comment[es]=Editar archivos de texto
Comment[fi]=Muokkaa tekstitiedostoja
Comment[fr]=Éditer des fichiers texte
Comment[ga]=Cuir comhaid téacs in eagar
@@ -61,7 +64,6 @@ Comment[da]=Rediger tekstfiler
Comment[el]=Επεξεργασία αρχείων κειμένου
Comment[en_CA]=Edit text files
Comment[en_GB]=Edit text files
Comment[es]=Edita archivos de texto
Comment[et]=Redigeeri tekstifaile
Comment[eu]=Editatu testu-fitxategiak
Comment[fa]=ویرایش پرونده‌های متنی
@@ -112,6 +114,7 @@ Type=Application
Keywords[ca]=Text;editor;
Keywords[de]=Text;Editor;
Keywords[eo]=Teksto;redaktilo;
Keywords[es]=Texto;editor;
Keywords[fi]=Teksti;muokkain;editori;
Keywords[fr]=Texte;éditeur;
Keywords[ga]=Téacs;eagarthóir;
+4 -3
View File
@@ -1,13 +1,13 @@
" Vim indent file
" Language: Fortran 2008 (and older: Fortran 2003, 95, 90, and 77)
" Version: (v48) 2020 October 07
" Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www2.unb.ca/~ajit/>
" Version: (v49) 2022 May 14
" Maintainer: Ajit J. Thakkar <thakkar.ajit@gmail.com>; <http://www2.unb.ca/~ajit/>
" Usage: For instructions, do :help fortran-indent from Vim
" Credits:
" Version 0.1 was created in September 2000 by Ajit Thakkar.
" Since then, useful suggestions and contributions have been made, in order, by:
" Albert Oliver Serra, Takuya Fujiwara, Philipp Edelmann, Eisuke Kawashima,
" and Louis Cochen.
" Louis Cochen, and Doug Kearns.
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
@@ -17,6 +17,7 @@ let b:did_indent = 1
let s:cposet=&cpoptions
set cpoptions&vim
let b:undo_indent = "setl inde< indk<"
setlocal indentkeys+==~end,=~case,=~if,=~else,=~do,=~where,=~elsewhere,=~select
setlocal indentkeys+==~endif,=~enddo,=~endwhere,=~endselect,=~elseif
+1 -3
View File
@@ -1,10 +1,8 @@
" PostScript indent file
" Language: PostScript
" Maintainer: Mike Williams <mrw@netcomuk.co.uk> (Invalid email address)
" Doug Kearns <dougkearns@gmail.com>
" Maintainer: Mike Williams <mrw@eandem.co.uk>
" Last Change: 2022 Apr 06
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
finish
+2 -2
View File
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: Vim help file
" Maintainer: Bram Moolenaar (Bram@vim.org)
" Last Change: 2022 May 13
" Last Change: 2022 May 15
" Quit when a (custom) syntax file was already loaded
if exists("b:current_syntax")
@@ -215,7 +215,7 @@ hi def link helpError Error
hi def link helpTodo Todo
hi def link helpURL String
if expand('%:p') =~ '[/\\]doc[/\\]syntax.txt'
if has('textprop') && expand('%:p') =~ '[/\\]doc[/\\]syntax.txt'
" highlight groups with their respective color
import 'dist/vimhelp.vim'
call vimhelp.HighlightGroups()
+8 -8
View File
@@ -1,8 +1,8 @@
" Vim syntax file
" Language: Vim 8.2 script
" Maintainer: Charles E. Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
" Last Change: May 07, 2022
" Version: 8.2-38
" Last Change: May 19, 2022
" Version: 8.2-39
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM
" Automatically generated keyword lists: {{{1
@@ -79,12 +79,12 @@ syn match vimHLGroup contained "Conceal"
syn case match
" Function Names {{{2
syn keyword vimFuncName contained abs argc assert_equal assert_match atan browse bufloaded byteidx charclass chdir ch_log ch_sendexpr col copy debugbreak diff_hlID empty execute expandcmd filter floor foldlevel function getchangelist getcmdcompltype getcompletion getfperm getline getpos gettabvar getwinposx has histget hlset input inputsecret isdirectory job_getchannel job_stop json_encode line listener_add log10 maplist matchaddpos matchfuzzypos menu_info nextnonblank popup_atcursor popup_dialog popup_getoptions popup_menu popup_show prompt_setcallback prop_clear prop_type_change pumvisible range reduce reltimestr remote_send resolve screenchar screenstring searchpairpos setbufvar setcursorcharpos setmatches settabwinvar shiftwidth sign_place simplify sound_clear spellbadword state strcharpart stridx strridx swapinfo synIDtrans tabpagenr tanh term_getaltscreen term_getline term_gettty term_setansicolors term_start test_garbagecollect_now test_null_blob test_null_list test_refcount test_void timer_stopall trunc uniq winbufnr win_getid win_id2win winnr win_splitmove
syn keyword vimFuncName contained acos argidx assert_equalfile assert_nobeep atan2 browsedir bufname byteidxcomp charcol ch_evalexpr ch_logfile ch_sendraw complete cos deepcopy digraph_get environ exepath extend finddir fmod foldtext garbagecollect getchar getcmdline getcurpos getfsize getloclist getqflist gettabwinvar getwinposy has_key histnr hostname inputdialog insert isinf job_info join keys line2byte listener_flush luaeval mapnew matcharg matchlist min nr2char popup_beval popup_filter_menu popup_getpos popup_move pow prompt_setinterrupt prop_find prop_type_delete py3eval readblob reg_executing remote_expr remote_startserver reverse screenchars search searchpos setcellwidths setenv setpos settagstack sign_define sign_placelist sin soundfold spellsuggest str2float strchars string strtrans swapname synstack tabpagewinnr tempname term_getansicolors term_getscrolled terminalprops term_setapi term_wait test_garbagecollect_soon test_null_channel test_null_partial test_setmouse timer_info tolower type values wincol win_gettype winlayout winrestcmd winwidth
syn keyword vimFuncName contained add arglistid assert_exception assert_notequal balloon_gettext bufadd bufnr call charidx ch_evalraw ch_open ch_setoptions complete_add cosh delete digraph_getlist escape exists extendnew findfile fnameescape foldtextresult get getcharmod getcmdpos getcursorcharpos getftime getmarklist getreg gettagstack getwinvar haslocaldir hlexists iconv inputlist interrupt islocked job_setoptions js_decode len lispindent listener_remove map mapset matchdelete matchstr mkdir or popup_clear popup_filter_yesno popup_hide popup_notification prevnonblank prompt_setprompt prop_list prop_type_get pyeval readdir reg_recording remote_foreground remove round screencol searchcount server2client setcharpos setfperm setqflist setwinvar sign_getdefined sign_undefine sinh sound_playevent split str2list strdisplaywidth strlen strwidth synconcealed system tagfiles term_dumpdiff term_getattr term_getsize term_list term_setkill test_alloc_fail test_getvalue test_null_dict test_null_string test_settime timer_pause toupper typename virtcol windowsversion win_gotoid winline winrestview wordcount
syn keyword vimFuncName contained and argv assert_fails assert_notmatch balloon_show bufexists bufwinid ceil ch_canread ch_getbufnr ch_read ch_status complete_check count deletebufline digraph_set eval exists_compiled feedkeys flatten fnamemodify foreground getbufinfo getcharpos getcmdscreenpos getcwd getftype getmatches getreginfo gettext glob hasmapto hlget indent inputrestore invert isnan job_start js_encode libcall list2blob localtime maparg match matchend matchstrpos mode pathshorten popup_close popup_findinfo popup_list popup_setoptions printf prop_add prop_remove prop_type_list pyxeval readdirex reltime remote_peek rename rubyeval screenpos searchdecl serverlist setcharsearch setline setreg sha256 sign_getplaced sign_unplace slice sound_playfile sqrt str2nr strftime strpart submatch synID systemlist taglist term_dumpload term_getcursor term_getstatus term_scrape term_setrestore test_autochdir test_gui_event test_null_function test_option_not_set test_srand_seed timer_start tr undofile visualmode win_execute winheight win_move_separator winsaveview writefile
syn keyword vimFuncName contained append asin assert_false assert_report balloon_split buflisted bufwinnr changenr ch_close ch_getjob ch_readblob cindent complete_info cscope_connection did_filetype digraph_setlist eventhandler exp filereadable flattennew foldclosed fullcommand getbufline getcharsearch getcmdtype getenv getimstatus getmousepos getregtype getwininfo glob2regpat histadd hlID index inputsave isabsolutepath items job_status json_decode libcallnr list2str log mapcheck matchadd matchfuzzy max mzeval perleval popup_create popup_findpreview popup_locate popup_settext prompt_getprompt prop_add_list prop_type_add pum_getpos rand readfile reltimefloat remote_read repeat screenattr screenrow searchpair setbufline setcmdpos setloclist settabvar shellescape sign_jump sign_unplacelist sort sound_stop srand strcharlen strgetchar strptime substitute synIDattr tabpagebuflist tan term_dumpwrite term_getjob term_gettitle term_sendkeys term_setsize test_feedinput test_ignore_error test_null_job test_override test_unknown timer_stop trim undotree wildmenumode win_findbuf win_id2tabwin win_move_statusline win_screenpos xor
syn keyword vimFuncName contained appendbufline assert_beeps assert_inrange assert_true blob2list bufload byte2line char2nr ch_close_in ch_info ch_readraw clearmatches confirm cursor diff_filler echoraw executable expand filewritable float2nr foldclosedend funcref getbufvar getcharstr getcmdwintype getfontname getjumplist getpid gettabinfo getwinpos globpath histdel
syn keyword vimFuncName contained abs argc assert_equal assert_match atan balloon_show bufexists bufwinid ceil ch_canread ch_getbufnr ch_read ch_status complete_check count deletebufline digraph_set eval exists_compiled feedkeys flatten fnamemodify foreground getbufinfo getcharpos getcmdscreenpos getcwd getftype getmatches getreginfo gettext glob hasmapto hlget index inputsecret isdirectory job_getchannel job_stop json_encode line listener_add log10 maplist matchaddpos matchfuzzypos menu_info nextnonblank popup_atcursor popup_dialog popup_getoptions popup_menu popup_show prompt_setcallback prop_clear prop_type_change pumvisible range reduce reltimestr remote_send resolve screenchar screenstring searchpairpos setbufvar setcursorcharpos setmatches settabwinvar shiftwidth sign_place simplify sound_clear spellbadword state strcharpart stridx strridx swapinfo synIDtrans tabpagenr tanh term_getaltscreen term_getline term_gettty term_setansicolors term_start test_garbagecollect_now test_null_blob test_null_list test_refcount test_void timer_stopall trunc uniq winbufnr win_getid win_id2win winnr win_splitmove
syn keyword vimFuncName contained acos argidx assert_equalfile assert_nobeep atan2 balloon_split buflisted bufwinnr changenr ch_close ch_getjob ch_readblob cindent complete_info cscope_connection did_filetype digraph_setlist eventhandler exp filereadable flattennew foldclosed fullcommand getbufline getcharsearch getcmdtype getenv getimstatus getmousepos getregtype getwininfo glob2regpat histadd hlID input insert isinf job_info join keys line2byte listener_flush luaeval mapnew matcharg matchlist min nr2char popup_beval popup_filter_menu popup_getpos popup_move pow prompt_setinterrupt prop_find prop_type_delete py3eval readblob reg_executing remote_expr remote_startserver reverse screenchars search searchpos setcellwidths setenv setpos settagstack sign_define sign_placelist sin soundfold spellsuggest str2float strchars string strtrans swapname synstack tabpagewinnr tempname term_getansicolors term_getscrolled terminalprops term_setapi term_wait test_garbagecollect_soon test_null_channel test_null_partial test_setmouse timer_info tolower type values wincol win_gettype winlayout winrestcmd winwidth
syn keyword vimFuncName contained add arglistid assert_exception assert_notequal autocmd_add blob2list bufload byte2line char2nr ch_close_in ch_info ch_readraw clearmatches confirm cursor diff_filler echoraw executable expand filewritable float2nr foldclosedend funcref getbufvar getcharstr getcmdwintype getfontname getjumplist getpid gettabinfo getwinpos globpath histdel hlset inputdialog interrupt islocked job_setoptions js_decode len lispindent listener_remove map mapset matchdelete matchstr mkdir or popup_clear popup_filter_yesno popup_hide popup_notification prevnonblank prompt_setprompt prop_list prop_type_get pyeval readdir reg_recording remote_foreground remove round screencol searchcount server2client setcharpos setfperm setqflist setwinvar sign_getdefined sign_undefine sinh sound_playevent split str2list strdisplaywidth strlen strwidth synconcealed system tagfiles term_dumpdiff term_getattr term_getsize term_list term_setkill test_alloc_fail test_getvalue test_null_dict test_null_string test_settime timer_pause toupper typename virtcol windowsversion win_gotoid winline winrestview wordcount
syn keyword vimFuncName contained and argv assert_fails assert_notmatch autocmd_delete browse bufloaded byteidx charclass chdir ch_log ch_sendexpr col copy debugbreak diff_hlID empty execute expandcmd filter floor foldlevel function getchangelist getcmdcompltype getcompletion getfperm getline getpos gettabvar getwinposx has histget hostname inputlist invert isnan job_start js_encode libcall list2blob localtime maparg match matchend matchstrpos mode pathshorten popup_close popup_findinfo popup_list popup_setoptions printf prop_add prop_remove prop_type_list pyxeval readdirex reltime remote_peek rename rubyeval screenpos searchdecl serverlist setcharsearch setline setreg sha256 sign_getplaced sign_unplace slice sound_playfile sqrt str2nr strftime strpart submatch synID systemlist taglist term_dumpload term_getcursor term_getstatus term_scrape term_setrestore test_autochdir test_gui_event test_null_function test_option_not_set test_srand_seed timer_start tr undofile visualmode win_execute winheight win_move_separator winsaveview writefile
syn keyword vimFuncName contained append asin assert_false assert_report autocmd_get browsedir bufname byteidxcomp charcol ch_evalexpr ch_logfile ch_sendraw complete cos deepcopy digraph_get environ exepath extend finddir fmod foldtext garbagecollect getchar getcmdline getcurpos getfsize getloclist getqflist gettabwinvar getwinposy has_key histnr iconv inputrestore isabsolutepath items job_status json_decode libcallnr list2str log mapcheck matchadd matchfuzzy max mzeval perleval popup_create popup_findpreview popup_locate popup_settext prompt_getprompt prop_add_list prop_type_add pum_getpos rand readfile reltimefloat remote_read repeat screenattr screenrow searchpair setbufline setcmdpos setloclist settabvar shellescape sign_jump sign_unplacelist sort sound_stop srand strcharlen strgetchar strptime substitute synIDattr tabpagebuflist tan term_dumpwrite term_getjob term_gettitle term_sendkeys term_setsize test_feedinput test_ignore_error test_null_job test_override test_unknown timer_stop trim undotree wildmenumode win_findbuf win_id2tabwin win_move_statusline win_screenpos xor
syn keyword vimFuncName contained appendbufline assert_beeps assert_inrange assert_true balloon_gettext bufadd bufnr call charidx ch_evalraw ch_open ch_setoptions complete_add cosh delete digraph_getlist escape exists extendnew findfile fnameescape foldtextresult get getcharmod getcmdpos getcursorcharpos getftime getmarklist getreg gettagstack getwinvar haslocaldir hlexists indent inputsave
"--- syntax here and above generated by mkvimvim ---
" Special Vim Highlighting (not automatic) {{{1
+4 -1
View File
@@ -5,6 +5,7 @@
Name[ca]=Vim
Name[de]=Vim
Name[eo]=Vim
Name[es]=Vim
Name[fi]=Vim
Name[fr]=Vim
Name[ga]=Vim
@@ -18,6 +19,7 @@ Name=Vim
GenericName[ca]=Editor de text
GenericName[de]=Texteditor
GenericName[eo]=Tekstoredaktilo
GenericName[es]=Editor de texto
GenericName[fi]=Tekstinmuokkain
GenericName[fr]=Éditeur de texte
GenericName[ga]=Eagarthóir Téacs
@@ -32,6 +34,7 @@ GenericName=Text Editor
Comment[ca]=Edita fitxers de text
Comment[de]=Textdateien bearbeiten
Comment[eo]=Redakti tekstajn dosierojn
Comment[es]=Editar archivos de texto
Comment[fi]=Muokkaa tekstitiedostoja
Comment[fr]=Éditer des fichiers texte
Comment[ga]=Cuir comhaid téacs in eagar
@@ -61,7 +64,6 @@ Comment[da]=Rediger tekstfiler
Comment[el]=Επεξεργασία αρχείων κειμένου
Comment[en_CA]=Edit text files
Comment[en_GB]=Edit text files
Comment[es]=Edita archivos de texto
Comment[et]=Redigeeri tekstifaile
Comment[eu]=Editatu testu-fitxategiak
Comment[fa]=ویرایش پروندههای متنی
@@ -112,6 +114,7 @@ Type=Application
Keywords[ca]=Text;editor;
Keywords[de]=Text;Editor;
Keywords[eo]=Teksto;redaktilo;
Keywords[es]=Texto;editor;
Keywords[fi]=Teksti;muokkain;editori;
Keywords[fr]=Texte;éditeur;
Keywords[ga]=Téacs;eagarthóir;
+1 -9
View File
@@ -290,9 +290,7 @@ open_buffer(
if (curbuf->b_flags & BF_NEVERLOADED)
{
(void)buf_init_chartab(curbuf, FALSE);
#ifdef FEAT_CINDENT
parse_cino(curbuf);
#endif
}
// Set/reset the Changed flag first, autocmds may change the buffer.
@@ -2278,7 +2276,7 @@ free_buf_options(
clear_string_option(&buf->b_p_inex);
# endif
#endif
#if defined(FEAT_CINDENT) && defined(FEAT_EVAL)
#if defined(FEAT_EVAL)
clear_string_option(&buf->b_p_inde);
clear_string_option(&buf->b_p_indk);
#endif
@@ -2339,14 +2337,10 @@ free_buf_options(
clear_string_option(&buf->b_p_sua);
#endif
clear_string_option(&buf->b_p_ft);
#ifdef FEAT_CINDENT
clear_string_option(&buf->b_p_cink);
clear_string_option(&buf->b_p_cino);
clear_string_option(&buf->b_p_cinsd);
#endif
#if defined(FEAT_CINDENT) || defined(FEAT_SMARTINDENT)
clear_string_option(&buf->b_p_cinw);
#endif
clear_string_option(&buf->b_p_cpt);
#ifdef FEAT_COMPL_FUNC
clear_string_option(&buf->b_p_cfu);
@@ -2376,9 +2370,7 @@ free_buf_options(
#endif
buf->b_p_ar = -1;
buf->b_p_ul = NO_LOCAL_UNDOLEVEL;
#ifdef FEAT_LISP
clear_string_option(&buf->b_p_lw);
#endif
clear_string_option(&buf->b_p_bkc);
clear_string_option(&buf->b_p_menc);
}
+16 -58
View File
@@ -1118,7 +1118,12 @@ ins_char_bytes(char_u *buf, int charlen)
ml_replace(lnum, newp, FALSE);
// mark the buffer as changed and prepare for displaying
inserted_bytes(lnum, col, newlen - oldlen);
changed_bytes(lnum, col);
#ifdef FEAT_PROP_POPUP
if (curbuf->b_has_textprop && newlen != oldlen)
adjust_prop_columns(lnum, col, newlen - oldlen,
State & REPLACE_FLAG ? APC_SUBSTITUTE : 0);
#endif
// If we're in Insert or Replace mode and 'showmatch' is set, then briefly
// show the match for right parens and braces.
@@ -1392,17 +1397,11 @@ open_line(
char_u *p;
int saved_char = NUL; // init for GCC
pos_T *pos;
#ifdef FEAT_CINDENT
int do_cindent;
#endif
#ifdef FEAT_SMARTINDENT
int do_si = may_do_si();
int no_si = FALSE; // reset did_si afterwards
int first_char = NUL; // init for GCC
#endif
#if defined(FEAT_LISP) || defined(FEAT_CINDENT)
int vreplace_mode;
#endif
int did_append; // appended a new line
int saved_pi = curbuf->b_p_pi; // copy of preserveindent setting
@@ -1448,22 +1447,18 @@ open_line(
if ((State & MODE_INSERT) && (State & VREPLACE_FLAG) == 0)
{
p_extra = saved_line + curwin->w_cursor.col;
#ifdef FEAT_SMARTINDENT
if (do_si) // need first char after new line break
{
p = skipwhite(p_extra);
first_char = *p;
}
#endif
extra_len = (int)STRLEN(p_extra);
saved_char = *p_extra;
*p_extra = NUL;
}
u_clearline(); // cannot do "U" command when adding lines
#ifdef FEAT_SMARTINDENT
did_si = FALSE;
#endif
ai_col = 0;
// If we just did an auto-indent, then we didn't type anything on
@@ -1474,11 +1469,7 @@ open_line(
// If 'autoindent' and/or 'smartindent' is set, try to figure out what
// indent to use for the new line.
if (curbuf->b_p_ai
#ifdef FEAT_SMARTINDENT
|| do_si
#endif
)
if (curbuf->b_p_ai || do_si)
{
// count white space on current line
#ifdef FEAT_VARTABS
@@ -1490,7 +1481,6 @@ open_line(
if (newindent == 0 && !(flags & OPENLINE_COM_LIST))
newindent = second_line_indent; // for ^^D command in insert mode
#ifdef FEAT_SMARTINDENT
// Do smart indenting.
// In insert/replace mode (only when dir == FORWARD)
// we may move some text to the next line. If it starts with '{'
@@ -1631,22 +1621,19 @@ open_line(
}
if (do_si)
can_si = TRUE;
#endif // FEAT_SMARTINDENT
did_ai = TRUE;
}
#ifdef FEAT_CINDENT
// May do indenting after opening a new line.
do_cindent = !p_paste && (curbuf->b_p_cin
# ifdef FEAT_EVAL
#ifdef FEAT_EVAL
|| *curbuf->b_p_inde != NUL
# endif
#endif
)
&& in_cinkeys(dir == FORWARD
? KEY_OPEN_FORW
: KEY_OPEN_BACK, ' ', linewhite(curwin->w_cursor.lnum));
#endif
// Find out if the current line starts with a comment leader.
// This may then be inserted in front of the new line.
@@ -1655,7 +1642,6 @@ open_line(
{
lead_len = get_leader_len(saved_line, &lead_flags,
dir == BACKWARD, TRUE);
#ifdef FEAT_CINDENT
if (lead_len == 0 && curbuf->b_p_cin && do_cindent && dir == FORWARD
&& !has_format_option(FO_NO_OPEN_COMS))
{
@@ -1673,7 +1659,6 @@ open_line(
}
}
}
#endif
}
else
lead_len = 0;
@@ -1979,11 +1964,7 @@ open_line(
}
// Recompute the indent, it may have changed.
if (curbuf->b_p_ai
#ifdef FEAT_SMARTINDENT
|| do_si
#endif
)
if (curbuf->b_p_ai || do_si)
#ifdef FEAT_VARTABS
newindent = get_indent_str_vtab(leader, curbuf->b_p_ts,
curbuf->b_p_vts_array, FALSE);
@@ -2030,11 +2011,7 @@ open_line(
// if a new indent will be set below, remove the indent that
// is in the comment leader
if (newindent
#ifdef FEAT_SMARTINDENT
|| did_si
#endif
)
if (newindent || did_si)
{
while (lead_len && VIM_ISWHITE(*leader))
{
@@ -2045,9 +2022,7 @@ open_line(
}
}
#ifdef FEAT_SMARTINDENT
did_si = can_si = FALSE;
#endif
}
else if (comment_end != NULL)
{
@@ -2056,11 +2031,7 @@ open_line(
// indent to align with the line containing the start of the
// comment.
if (comment_end[0] == '*' && comment_end[1] == '/' &&
(curbuf->b_p_ai
#ifdef FEAT_SMARTINDENT
|| do_si
#endif
))
(curbuf->b_p_ai || do_si))
{
old_cursor = curwin->w_cursor;
curwin->w_cursor.col = (colnr_T)(comment_end - saved_line);
@@ -2177,14 +2148,9 @@ open_line(
did_append = FALSE;
}
if (newindent
#ifdef FEAT_SMARTINDENT
|| did_si
#endif
)
if (newindent || did_si)
{
++curwin->w_cursor.lnum;
#ifdef FEAT_SMARTINDENT
if (did_si)
{
int sw = (int)get_sw_value(curbuf);
@@ -2193,7 +2159,6 @@ open_line(
newindent -= newindent % sw;
newindent += sw;
}
#endif
// Copy the indent
if (curbuf->b_p_ci)
{
@@ -2216,10 +2181,8 @@ open_line(
for (n = 0; n < (int)curwin->w_cursor.col; ++n)
replace_push(NUL);
newcol += curwin->w_cursor.col;
#ifdef FEAT_SMARTINDENT
if (no_si)
did_si = FALSE;
#endif
}
// In MODE_REPLACE state, for each character in the extra leader, there
@@ -2273,7 +2236,6 @@ open_line(
curwin->w_cursor.col = newcol;
curwin->w_cursor.coladd = 0;
#if defined(FEAT_LISP) || defined(FEAT_CINDENT)
// In MODE_VREPLACE state, we are handling the replace stack ourselves, so
// stop fixthisline() from doing it (via change_indent()) by telling it
// we're in normal MODE_INSERT state.
@@ -2284,8 +2246,7 @@ open_line(
}
else
vreplace_mode = 0;
#endif
#ifdef FEAT_LISP
// May do lisp indenting.
if (!p_paste
&& leader == NULL
@@ -2295,19 +2256,16 @@ open_line(
fixthisline(get_lisp_indent);
ai_col = (colnr_T)getwhitecols_curline();
}
#endif
#ifdef FEAT_CINDENT
// May do indenting after opening a new line.
if (do_cindent)
{
do_c_expr_indent();
ai_col = (colnr_T)getwhitecols_curline();
}
#endif
#if defined(FEAT_LISP) || defined(FEAT_CINDENT)
if (vreplace_mode != 0)
State = vreplace_mode;
#endif
// Finally, MODE_VREPLACE gets the stuff on the new line, then puts back
// the original line, and inserts the new stuff char by char, pushing old
-2
View File
@@ -129,13 +129,11 @@ buf_init_chartab(
SET_CHARTAB(buf, c);
}
#ifdef FEAT_LISP
/*
* In lisp mode the '-' character is included in keywords.
*/
if (buf->b_p_lisp)
SET_CHARTAB(buf, '-');
#endif
// Walk through the 'isident', 'iskeyword', 'isfname' and 'isprint'
// options Each option is a list of characters, character numbers or
+2 -11
View File
@@ -32,7 +32,6 @@
#define LOOKFOR_JS_KEY 11
#define LOOKFOR_COMMA 12
#if defined(FEAT_CINDENT) || defined(FEAT_SMARTINDENT)
/*
* Return TRUE if the string "line" starts with a word from 'cinwords'.
*/
@@ -64,7 +63,6 @@ cin_is_cinword(char_u *line)
}
return retval;
}
#endif
/*
* Skip to the end of a "string" and a 'c' character.
@@ -148,8 +146,6 @@ is_pos_in_string(char_u *line, colnr_T col)
return !((colnr_T)(p - line) <= col);
}
#if defined(FEAT_CINDENT) || defined(FEAT_SYN_HL)
/*
* Find the start of a comment, not knowing if we are in a comment right now.
* Search starts at w_cursor.lnum and goes backwards.
@@ -254,9 +250,7 @@ ind_find_start_CORS(linenr_T *is_raw) // XXX
}
return comment_pos;
}
#endif // FEAT_CINDENT || FEAT_SYN_HL
#if defined(FEAT_CINDENT) || defined(PROTO)
/*
* Return TRUE if C-indenting is on.
@@ -265,9 +259,9 @@ ind_find_start_CORS(linenr_T *is_raw) // XXX
cindent_on(void)
{
return (!p_paste && (curbuf->b_p_cin
# ifdef FEAT_EVAL
#ifdef FEAT_EVAL
|| *curbuf->b_p_inde != NUL
# endif
#endif
));
}
@@ -4151,7 +4145,6 @@ do_c_expr_indent(void)
# endif
fixthisline(get_c_indent);
}
#endif
#if defined(FEAT_EVAL) || defined(PROTO)
/*
@@ -4160,7 +4153,6 @@ do_c_expr_indent(void)
void
f_cindent(typval_T *argvars UNUSED, typval_T *rettv)
{
# ifdef FEAT_CINDENT
pos_T pos;
linenr_T lnum;
@@ -4176,7 +4168,6 @@ f_cindent(typval_T *argvars UNUSED, typval_T *rettv)
curwin->w_cursor = pos;
}
else
# endif
rettv->vval.v_number = -1;
}
#endif
+1 -65
View File
@@ -84,9 +84,7 @@ static int last_insert_skip; // nr of chars in front of previous insert
static int new_insert_skip; // nr of chars in front of current insert
static int did_restart_edit; // "restart_edit" when calling edit()
#ifdef FEAT_CINDENT
static int can_cindent; // may do cindenting on this line
#endif
#ifdef FEAT_RIGHTLEFT
static int revins_on; // reverse insert mode on
@@ -134,9 +132,7 @@ edit(
static linenr_T o_lnum = 0;
int i;
int did_backspace = TRUE; // previous char was backspace
#ifdef FEAT_CINDENT
int line_is_white = FALSE; // line is empty before insert
#endif
linenr_T old_topline = 0; // topline before insertion
#ifdef FEAT_DIFF
int old_topfill = -1;
@@ -387,9 +383,7 @@ edit(
ins_need_undo = TRUE;
where_paste_started.lnum = 0;
#ifdef FEAT_CINDENT
can_cindent = TRUE;
#endif
#ifdef FEAT_FOLDING
// The cursor line is not in a closed fold, unless 'insertmode' is set or
// restarting.
@@ -742,7 +736,6 @@ edit(
continue;
}
#ifdef FEAT_CINDENT
if (cindent_on() && ctrl_x_mode_none())
{
// A key name preceded by a bang means this key is not to be
@@ -756,7 +749,6 @@ edit(
&& stop_arrow() == OK)
do_c_expr_indent();
}
#endif
#ifdef FEAT_RIGHTLEFT
if (curwin->w_p_rl)
@@ -1303,9 +1295,7 @@ docomplete:
disable_fold_update--;
#endif
compl_busy = FALSE;
#ifdef FEAT_SMARTINDENT
can_si = may_do_si(); // allow smartindenting
#endif
break;
case Ctrl_Y: // copy from previous line or scroll down
@@ -1355,18 +1345,14 @@ normalchar:
break;
}
#endif
#ifdef FEAT_SMARTINDENT
// Try to perform smart-indenting.
ins_try_si(c);
#endif
if (c == ' ')
{
inserted_space = TRUE;
#ifdef FEAT_CINDENT
if (inindent(0))
can_cindent = FALSE;
#endif
if (Insstart_blank_vcol == MAXCOL
&& curwin->w_cursor.lnum == Insstart.lnum)
Insstart_blank_vcol = get_nolist_virtcol();
@@ -1411,7 +1397,6 @@ normalchar:
if (arrow_used)
inserted_space = FALSE;
#ifdef FEAT_CINDENT
if (can_cindent && cindent_on() && ctrl_x_mode_normal())
{
force_cindent:
@@ -1425,7 +1410,6 @@ force_cindent:
do_c_expr_indent();
}
}
#endif // FEAT_CINDENT
} // for (;;)
// NOTREACHED
@@ -2203,11 +2187,9 @@ insertchar(
end_comment_pending = NUL;
did_ai = FALSE;
#ifdef FEAT_SMARTINDENT
did_si = FALSE;
can_si = FALSE;
can_si_back = FALSE;
#endif
/*
* If there's any pending input, grab up to INPUT_BUFLEN at once.
@@ -2229,9 +2211,7 @@ insertchar(
&& !has_insertcharpre()
&& vpeekc() != NUL
&& !(State & REPLACE_FLAG)
#ifdef FEAT_CINDENT
&& !cindent_on()
#endif
#ifdef FEAT_RIGHTLEFT
&& !p_ri
#endif
@@ -2555,11 +2535,9 @@ stop_insert(
}
}
did_ai = FALSE;
#ifdef FEAT_SMARTINDENT
did_si = FALSE;
can_si = FALSE;
can_si_back = FALSE;
#endif
// Set '[ and '] to the inserted text. When end_insert_pos is NULL we are
// now in a different buffer.
@@ -3907,14 +3885,10 @@ ins_shift(int c, int lastc)
if (did_ai && *skipwhite(ml_get_curline()) != NUL)
did_ai = FALSE;
#ifdef FEAT_SMARTINDENT
did_si = FALSE;
can_si = FALSE;
can_si_back = FALSE;
#endif
#ifdef FEAT_CINDENT
can_cindent = FALSE; // no cindenting after ^D or ^T
#endif
}
static void
@@ -3944,11 +3918,9 @@ ins_del(void)
else if (del_char(FALSE) == FAIL) // delete char under cursor
vim_beep(BO_BS);
did_ai = FALSE;
#ifdef FEAT_SMARTINDENT
did_si = FALSE;
can_si = FALSE;
can_si_back = FALSE;
#endif
AppendCharToRedobuff(K_DEL);
}
@@ -3991,9 +3963,7 @@ ins_bs(
int in_indent;
int oldState;
int cpc[MAX_MCO]; // composing characters
#if defined(FEAT_LISP) || defined(FEAT_CINDENT)
int call_fix_indent = FALSE;
#endif
/*
* can't delete anything in an empty file
@@ -4025,10 +3995,8 @@ ins_bs(
if (stop_arrow() == FAIL)
return FALSE;
in_indent = inindent(0);
#ifdef FEAT_CINDENT
if (in_indent)
can_cindent = FALSE;
#endif
end_comment_pending = NUL; // After BS, don't auto-end comment
#ifdef FEAT_RIGHTLEFT
if (revins_on) // put cursor after last inserted char
@@ -4162,11 +4130,7 @@ ins_bs(
mincol = 0;
// keep indent
if (mode == BACKSPACE_LINE
&& (curbuf->b_p_ai
#ifdef FEAT_CINDENT
|| cindent_on()
#endif
)
&& (curbuf->b_p_ai || cindent_on())
#ifdef FEAT_RIGHTLEFT
&& !revins_on
#endif
@@ -4177,10 +4141,8 @@ ins_bs(
if (curwin->w_cursor.col < save_col)
{
mincol = curwin->w_cursor.col;
#if defined(FEAT_LISP) || defined(FEAT_CINDENT)
// should now fix the indent to match with the previous line
call_fix_indent = TRUE;
#endif
}
curwin->w_cursor.col = save_col;
}
@@ -4346,18 +4308,14 @@ ins_bs(
}
did_backspace = TRUE;
}
#ifdef FEAT_SMARTINDENT
did_si = FALSE;
can_si = FALSE;
can_si_back = FALSE;
#endif
if (curwin->w_cursor.col <= 1)
did_ai = FALSE;
#if defined(FEAT_LISP) || defined(FEAT_CINDENT)
if (call_fix_indent)
fix_indent();
#endif
/*
* It's a little strange to put backspaces into the redo
@@ -4506,9 +4464,7 @@ ins_tabline(int c)
{
undisplay_dollar();
start_arrow(&curwin->w_cursor);
# ifdef FEAT_CINDENT
can_cindent = TRUE;
# endif
}
if (c == K_TABLINE)
@@ -4532,9 +4488,7 @@ ins_scroll(void)
if (gui_do_scroll())
{
start_arrow(&tpos);
# ifdef FEAT_CINDENT
can_cindent = TRUE;
# endif
}
}
@@ -4548,9 +4502,7 @@ ins_horscroll(void)
if (gui_do_horiz_scroll(scrollbar_value, FALSE))
{
start_arrow(&tpos);
# ifdef FEAT_CINDENT
can_cindent = TRUE;
# endif
}
}
#endif
@@ -4757,9 +4709,7 @@ ins_up(
)
redraw_later(VALID);
start_arrow(&tpos);
#ifdef FEAT_CINDENT
can_cindent = TRUE;
#endif
}
else
vim_beep(BO_CRSR);
@@ -4787,9 +4737,7 @@ ins_pageup(void)
if (onepage(BACKWARD, 1L) == OK)
{
start_arrow(&tpos);
#ifdef FEAT_CINDENT
can_cindent = TRUE;
#endif
}
else
vim_beep(BO_CRSR);
@@ -4818,9 +4766,7 @@ ins_down(
)
redraw_later(VALID);
start_arrow(&tpos);
#ifdef FEAT_CINDENT
can_cindent = TRUE;
#endif
}
else
vim_beep(BO_CRSR);
@@ -4848,9 +4794,7 @@ ins_pagedown(void)
if (onepage(FORWARD, 1L) == OK)
{
start_arrow(&tpos);
#ifdef FEAT_CINDENT
can_cindent = TRUE;
#endif
}
else
vim_beep(BO_CRSR);
@@ -4881,10 +4825,8 @@ ins_tab(void)
return FALSE;
ind = inindent(0);
#ifdef FEAT_CINDENT
if (ind)
can_cindent = FALSE;
#endif
/*
* When nothing special, insert TAB like a normal character.
@@ -4910,11 +4852,9 @@ ins_tab(void)
return TRUE;
did_ai = FALSE;
#ifdef FEAT_SMARTINDENT
did_si = FALSE;
can_si = FALSE;
can_si_back = FALSE;
#endif
AppendToRedobuff((char_u *)"\t");
#ifdef FEAT_VARTABS
@@ -5182,9 +5122,7 @@ ins_eol(int c)
has_format_option(FO_RET_COMS) ? OPENLINE_DO_COM : 0, old_indent,
NULL);
old_indent = 0;
#ifdef FEAT_CINDENT
can_cindent = TRUE;
#endif
#ifdef FEAT_FOLDING
// When inserting a line the cursor line must never be in a closed fold.
foldOpenCursor();
@@ -5436,7 +5374,6 @@ do_insert_char_pre(int c)
}
#endif
#if defined(FEAT_CINDENT) || defined(PROTO)
int
get_can_cindent(void)
{
@@ -5448,7 +5385,6 @@ set_can_cindent(int val)
{
can_cindent = val;
}
#endif
/*
* Trigger "event" and take care of fixing undo.
+3 -21
View File
@@ -5476,13 +5476,7 @@ f_has(typval_T *argvars, typval_T *rettv)
0
#endif
},
{"cindent",
#ifdef FEAT_CINDENT
1
#else
0
#endif
},
{"cindent", 1},
{"clientserver",
#ifdef FEAT_CLIENTSERVER
1
@@ -5810,13 +5804,7 @@ f_has(typval_T *argvars, typval_T *rettv)
0
#endif
},
{"lispindent",
#ifdef FEAT_LISP
1
#else
0
#endif
},
{"lispindent", 1},
{"listcmds", 1},
{"localmap", 1},
{"lua",
@@ -6105,13 +6093,7 @@ f_has(typval_T *argvars, typval_T *rettv)
0
#endif
},
{"smartindent",
#ifdef FEAT_SMARTINDENT
1
#else
0
#endif
},
{"smartindent", 1},
{"startuptime",
#ifdef STARTUPTIME
1
+1 -1
View File
@@ -465,7 +465,7 @@ EXCMD(CMD_def, "def", ex_function,
EX_EXTRA|EX_BANG|EX_SBOXOK|EX_CMDWIN|EX_LOCK_OK,
ADDR_NONE),
EXCMD(CMD_defcompile, "defcompile", ex_defcompile,
EX_SBOXOK|EX_CMDWIN|EX_LOCK_OK|EX_TRLBAR,
EX_SBOXOK|EX_CMDWIN|EX_LOCK_OK|EX_TRLBAR|EX_EXTRA,
ADDR_NONE),
EXCMD(CMD_delcommand, "delcommand", ex_delcommand,
EX_NEEDARG|EX_WORD1|EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK,
+3 -19
View File
@@ -111,6 +111,9 @@
* +comments 'comments' option.
* +title 'title' and 'icon' options
* +jumplist Jumplist, CTRL-O and CTRL-I commands.
* +lispindent lisp indenting (From Eric Fischer).
* +cindent C code indenting (From Eric Fischer).
* +smartindent smart C code indenting when the 'si' option is set.
*
* Obsolete:
* +tag_old_static Old style static tags: "file:tag file ..".
@@ -431,25 +434,6 @@
# endif
#endif
/*
* +lispindent lisp indenting (From Eric Fischer).
* +cindent C code indenting (From Eric Fischer).
* +smartindent smart C code indenting when the 'si' option is set.
*
* These two need to be defined when making prototypes.
*/
#if defined(FEAT_NORMAL) || defined(PROTO)
# define FEAT_LISP
#endif
#if defined(FEAT_NORMAL) || defined(PROTO)
# define FEAT_CINDENT
#endif
#ifdef FEAT_NORMAL
# define FEAT_SMARTINDENT
#endif
/*
* +cryptv Encryption (by Mohsin Ahmed <mosh@sasi.com>).
*/
+12 -4
View File
@@ -829,10 +829,18 @@ foldUpdate(win_T *wp, linenr_T top, linenr_T bot)
if (wp->w_folds.ga_len > 0)
{
// Mark all folds from top to bot as maybe-small.
(void)foldFind(&wp->w_folds, top, &fp);
linenr_T maybe_small_start = top;
linenr_T maybe_small_end = bot;
// Mark all folds from top to bot (or bot to top) as maybe-small.
if (top > bot)
{
maybe_small_start = bot;
maybe_small_end = top;
}
(void)foldFind(&wp->w_folds, maybe_small_start, &fp);
while (fp < (fold_T *)wp->w_folds.ga_data + wp->w_folds.ga_len
&& fp->fd_top < bot)
&& fp->fd_top <= maybe_small_end)
{
fp->fd_small = MAYBE;
++fp;
@@ -2165,7 +2173,7 @@ foldUpdateIEMS(win_T *wp, linenr_T top, linenr_T bot)
bot = wp->w_buffer->b_ml.ml_line_count;
wp->w_foldinvalid = FALSE;
// Mark all folds a maybe-small.
// Mark all folds as maybe-small.
setSmallMaybe(&wp->w_folds);
}
-2
View File
@@ -937,7 +937,6 @@ EXTERN int end_comment_pending INIT(= NUL);
*/
EXTERN int did_syncbind INIT(= FALSE);
#ifdef FEAT_SMARTINDENT
/*
* This flag is set when a smart indent has been performed. When the next typed
* character is a '{' the inserted tab will be deleted again.
@@ -955,7 +954,6 @@ EXTERN int can_si INIT(= FALSE);
* one indent will be removed.
*/
EXTERN int can_si_back INIT(= FALSE);
#endif
EXTERN int old_indent INIT(= 0); // for ^^D command in insert mode
+1 -32
View File
@@ -1055,7 +1055,6 @@ inindent(int extra)
return FALSE;
}
#if defined(FEAT_LISP) || defined(FEAT_CINDENT) || defined(PROTO)
/*
* op_reindent - handle reindenting a block of lines.
*/
@@ -1092,10 +1091,8 @@ op_reindent(oparg_T *oap, int (*how)(void))
// Be vi-compatible: For lisp indenting the first line is not
// indented, unless there is only one line.
# ifdef FEAT_LISP
if (i != oap->line_count - 1 || oap->line_count == 1
|| how != get_lisp_indent)
# endif
{
l = skipwhite(ml_get_curline());
if (*l == NUL) // empty or blank line
@@ -1142,9 +1139,7 @@ op_reindent(oparg_T *oap, int (*how)(void))
curbuf->b_op_end = oap->end;
}
}
#endif // defined(FEAT_LISP) || defined(FEAT_CINDENT)
#if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT) || defined(PROTO)
/*
* Return TRUE if lines starting with '#' should be left aligned.
*/
@@ -1152,22 +1147,12 @@ op_reindent(oparg_T *oap, int (*how)(void))
preprocs_left(void)
{
return
# ifdef FEAT_SMARTINDENT
# ifdef FEAT_CINDENT
(curbuf->b_p_si && !curbuf->b_p_cin) ||
# else
curbuf->b_p_si
# endif
# endif
# ifdef FEAT_CINDENT
(curbuf->b_p_cin && in_cinkeys('#', ' ', TRUE)
&& curbuf->b_ind_hash_comment == 0)
# endif
;
}
#endif
#ifdef FEAT_SMARTINDENT
/*
* Return TRUE if the conditions are OK for smart indenting.
*/
@@ -1175,9 +1160,7 @@ preprocs_left(void)
may_do_si()
{
return curbuf->b_p_si
# ifdef FEAT_CINDENT
&& !curbuf->b_p_cin
# endif
# ifdef FEAT_EVAL
&& *curbuf->b_p_inde == NUL
# endif
@@ -1263,7 +1246,6 @@ ins_try_si(int c)
if (ai_col > curwin->w_cursor.col)
ai_col = curwin->w_cursor.col;
}
#endif
/*
* Insert an indent (for <Tab> or CTRL-T) or delete an indent (for CTRL-D).
@@ -1865,7 +1847,7 @@ ex_retab(exarg_T *eap)
u_clearline();
}
#if (defined(FEAT_CINDENT) && defined(FEAT_EVAL)) || defined(PROTO)
#if defined(FEAT_EVAL) || defined(PROTO)
/*
* Get indent level from 'indentexpr'.
*/
@@ -1933,8 +1915,6 @@ get_expr_indent(void)
}
#endif
#if defined(FEAT_LISP) || defined(PROTO)
static int
lisp_match(char_u *p)
{
@@ -2150,9 +2130,7 @@ get_lisp_indent(void)
return amount;
}
#endif // FEAT_LISP
#if defined(FEAT_LISP) || defined(FEAT_CINDENT) || defined(PROTO)
/*
* Re-indent the current line, based on the current contents of it and the
* surrounding lines. Fixing the cursor position seems really easy -- I'm very
@@ -2181,19 +2159,12 @@ fix_indent(void)
{
if (p_paste)
return;
# ifdef FEAT_LISP
if (curbuf->b_p_lisp && curbuf->b_p_ai)
fixthisline(get_lisp_indent);
# endif
# if defined(FEAT_LISP) && defined(FEAT_CINDENT)
else
# endif
# ifdef FEAT_CINDENT
if (cindent_on())
do_c_expr_indent();
# endif
}
#endif
#if defined(FEAT_EVAL) || defined(PROTO)
/*
@@ -2224,7 +2195,6 @@ f_indent(typval_T *argvars, typval_T *rettv)
void
f_lispindent(typval_T *argvars UNUSED, typval_T *rettv)
{
# ifdef FEAT_LISP
pos_T pos;
linenr_T lnum;
@@ -2242,7 +2212,6 @@ f_lispindent(typval_T *argvars UNUSED, typval_T *rettv)
else if (in_vim9script())
semsg(_(e_invalid_line_number_nr), lnum);
else
# endif
rettv->vval.v_number = -1;
}
#endif
+1 -12
View File
@@ -263,9 +263,7 @@ ins_ctrl_x(void)
/*
* Functions to check the current CTRL-X mode.
*/
#ifdef FEAT_CINDENT
int ctrl_x_mode_none(void) { return ctrl_x_mode == 0; }
#endif
int ctrl_x_mode_normal(void) { return ctrl_x_mode == CTRL_X_NORMAL; }
int ctrl_x_mode_scroll(void) { return ctrl_x_mode == CTRL_X_SCROLL; }
int ctrl_x_mode_whole_line(void) { return ctrl_x_mode == CTRL_X_WHOLE_LINE; }
@@ -2151,9 +2149,7 @@ set_ctrl_x_mode(int c)
ins_compl_stop(int c, int prev_mode, int retval)
{
char_u *ptr;
#ifdef FEAT_CINDENT
int want_cindent;
#endif
// Get here when we have finished typing a sequence of ^N and
// ^P or other completion characters in CTRL-X mode. Free up
@@ -2173,21 +2169,18 @@ ins_compl_stop(int c, int prev_mode, int retval)
ins_compl_fixRedoBufForLeader(ptr);
}
#ifdef FEAT_CINDENT
want_cindent = (get_can_cindent() && cindent_on());
#endif
// When completing whole lines: fix indent for 'cindent'.
// Otherwise, break line if it's too long.
if (compl_cont_mode == CTRL_X_WHOLE_LINE)
{
#ifdef FEAT_CINDENT
// re-indent the current line
if (want_cindent)
{
do_c_expr_indent();
want_cindent = FALSE; // don't do it again
}
#endif
}
else
{
@@ -2251,11 +2244,9 @@ ins_compl_stop(int c, int prev_mode, int retval)
// command line window.
update_screen(0);
#endif
#ifdef FEAT_CINDENT
// Indent now if a key was typed that is in 'cinkeys'.
if (want_cindent && in_cinkeys(KEY_COMPLETE, ' ', inindent(0)))
do_c_expr_indent();
#endif
// Trigger the CompleteDone event to give scripts a chance to act
// upon the end of completion.
ins_apply_autocmds(EVENT_COMPLETEDONE);
@@ -4742,11 +4733,9 @@ ins_compl_start(void)
// First time we hit ^N or ^P (in a row, I mean)
did_ai = FALSE;
#ifdef FEAT_SMARTINDENT
did_si = FALSE;
can_si = FALSE;
can_si_back = FALSE;
#endif
if (stop_arrow() == FAIL)
return FAIL;
+2 -2
View File
@@ -548,13 +548,13 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
break;
if (item == NULL || item->v_type != VAR_LIST
|| item->vval.v_list == NULL)
|| item->vval.v_list == NULL
|| item->vval.v_list->lv_first == &range_list_item)
{
semsg(_(e_invalid_value_for_argument_str), "ansi_colors");
return FAIL;
}
CHECK_LIST_MATERIALIZE(item->vval.v_list);
li = item->vval.v_list->lv_first;
for (; li != NULL && n < 16; li = li->li_next, n++)
{
-4
View File
@@ -2265,10 +2265,8 @@ command_line_scan(mparm_T *parmp)
break;
case 'l': // "-l" lisp mode, 'lisp' and 'showmatch' on
#ifdef FEAT_LISP
set_option_value_give_err((char_u *)"lisp", 1L, NULL, 0);
p_sm = TRUE;
#endif
break;
case 'M': // "-M" no changes or writing of files
@@ -3579,9 +3577,7 @@ usage(void)
main_msg(_("-m\t\t\tModifications (writing files) not allowed"));
main_msg(_("-M\t\t\tModifications in text not allowed"));
main_msg(_("-b\t\t\tBinary mode"));
#ifdef FEAT_LISP
main_msg(_("-l\t\t\tLisp mode"));
#endif
main_msg(_("-C\t\t\tCompatible with Vi: 'compatible'"));
main_msg(_("-N\t\t\tNot fully Vi compatible: 'nocompatible'"));
main_msg(_("-V[N][fname]\t\tBe verbose [level N] [log messages to fname]"));
+1 -5
View File
@@ -1084,9 +1084,7 @@ ins_mouse(int c)
curwin = new_curwin;
curbuf = curwin->w_buffer;
}
# ifdef FEAT_CINDENT
set_can_cindent(TRUE);
# endif
}
// redraw status lines (in case another window became active)
@@ -1191,9 +1189,7 @@ ins_mousescroll(int dir)
if (!EQUAL_POS(curwin->w_cursor, tpos))
{
start_arrow(&tpos);
# ifdef FEAT_CINDENT
set_can_cindent(TRUE);
# endif
}
}
@@ -1841,7 +1837,7 @@ retnomove:
if (dragwin != NULL)
{
// Drag the status line
count = row - dragwin->w_winrow - dragwin->w_height + 1
count = row - W_WINROW(dragwin) - dragwin->w_height + 1
- on_status_line;
win_drag_status_line(dragwin, count);
did_drag |= count;
+3 -17
View File
@@ -159,10 +159,8 @@ op_shift(oparg_T *oap, int curs_top, int amount)
else
// Move the line right if it doesn't start with '#', 'smartindent'
// isn't set or 'cindent' isn't set or '#' isn't in 'cino'.
#if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT)
if (first_char != '#' || !preprocs_left())
#endif
shift_line(oap->op_type == OP_LSHIFT, p_sr, amount, FALSE);
shift_line(oap->op_type == OP_LSHIFT, p_sr, amount, FALSE);
++curwin->w_cursor.lnum;
}
@@ -1717,9 +1715,7 @@ op_change(oparg_T *oap)
if (oap->motion_type == MLINE)
{
l = 0;
#ifdef FEAT_SMARTINDENT
can_si = may_do_si(); // Like opening a new line, do smart indent
#endif
}
// First delete the text in the region. In an empty buffer only need to
@@ -1750,10 +1746,8 @@ op_change(oparg_T *oap)
bd.textcol = curwin->w_cursor.col;
}
#if defined(FEAT_LISP) || defined(FEAT_CINDENT)
if (oap->motion_type == MLINE)
fix_indent();
#endif
retval = edit(NUL, FALSE, (linenr_T)1);
@@ -3292,11 +3286,9 @@ op_colon(oparg_T *oap)
stuffReadbuff((char_u *)"!");
if (oap->op_type == OP_INDENT)
{
#ifndef FEAT_CINDENT
if (*get_equalprg() == NUL)
stuffReadbuff((char_u *)"indent");
else
#endif
stuffReadbuff(get_equalprg());
stuffReadbuff((char_u *)"\n");
}
@@ -4057,27 +4049,21 @@ do_pending_operator(cmdarg_T *cap, int old_col, int gui_yank)
case OP_INDENT:
case OP_COLON:
#if defined(FEAT_LISP) || defined(FEAT_CINDENT)
// If 'equalprg' is empty, do the indenting internally.
if (oap->op_type == OP_INDENT && *get_equalprg() == NUL)
{
# ifdef FEAT_LISP
if (curbuf->b_p_lisp)
{
op_reindent(oap, get_lisp_indent);
break;
}
# endif
# ifdef FEAT_CINDENT
op_reindent(oap,
# ifdef FEAT_EVAL
#ifdef FEAT_EVAL
*curbuf->b_p_inde != NUL ? get_expr_indent :
# endif
#endif
get_c_indent);
break;
# endif
}
#endif
op_colon(oap);
break;
+7 -38
View File
@@ -676,9 +676,7 @@ set_options_default(
// The 'scroll' option must be computed for all windows.
FOR_ALL_TAB_WINDOWS(tp, wp)
win_comp_scroll(wp);
#ifdef FEAT_CINDENT
parse_cino(curbuf);
#endif
}
/*
@@ -2560,9 +2558,7 @@ insecure_flag(int opt_idx, int opt_flags)
# ifdef FEAT_BEVAL
case PV_BEXPR: return &curbuf->b_p_bexpr_flags;
# endif
# if defined(FEAT_CINDENT)
case PV_INDE: return &curbuf->b_p_inde_flags;
# endif
case PV_FEX: return &curbuf->b_p_fex_flags;
# ifdef FEAT_FIND_ID
case PV_INEX: return &curbuf->b_p_inex_flags;
@@ -3059,12 +3055,10 @@ set_bool_option(
* When 'lisp' option changes include/exclude '-' in
* keyword characters.
*/
#ifdef FEAT_LISP
else if (varp == (char_u *)&(curbuf->b_p_lisp))
{
(void)buf_init_chartab(curbuf, FALSE); // ignore errors
}
#endif
// when 'title' changed, may need to change the title; same for 'icon'
else if ((int *)varp == &p_title || (int *)varp == &p_icon)
@@ -3326,6 +3320,7 @@ set_bool_option(
# endif
# ifdef FEAT_TERMINAL
term_update_colors_all();
term_update_palette_all();
term_update_wincolor_all();
# endif
}
@@ -3570,22 +3565,18 @@ set_num_option(
}
#endif // FEAT_FOLDING
#if defined(FEAT_FOLDING) || defined(FEAT_CINDENT)
// 'shiftwidth' or 'tabstop'
else if (pp == &curbuf->b_p_sw || pp == &curbuf->b_p_ts)
{
# ifdef FEAT_FOLDING
#ifdef FEAT_FOLDING
if (foldmethodIsIndent(curwin))
foldUpdateAll(curwin);
# endif
# ifdef FEAT_CINDENT
#endif
// When 'shiftwidth' changes, or it's zero and 'tabstop' changes:
// parse 'cinoptions'.
if (pp == &curbuf->b_p_sw || curbuf->b_p_sw == 0)
parse_cino(curbuf);
# endif
}
#endif
// 'maxcombine'
else if (pp == &p_mco)
@@ -5313,11 +5304,9 @@ unset_global_local_option(char_u *name, void *from)
case PV_UL:
buf->b_p_ul = NO_LOCAL_UNDOLEVEL;
break;
#ifdef FEAT_LISP
case PV_LW:
clear_string_option(&buf->b_p_lw);
break;
#endif
case PV_MENC:
clear_string_option(&buf->b_p_menc);
break;
@@ -5387,9 +5376,7 @@ get_varp_scope(struct vimoption *p, int scope)
case PV_STL: return (char_u *)&(curwin->w_p_stl);
#endif
case PV_UL: return (char_u *)&(curbuf->b_p_ul);
#ifdef FEAT_LISP
case PV_LW: return (char_u *)&(curbuf->b_p_lw);
#endif
case PV_BKC: return (char_u *)&(curbuf->b_p_bkc);
case PV_MENC: return (char_u *)&(curbuf->b_p_menc);
case PV_LCS: return (char_u *)&(curwin->w_p_lcs);
@@ -5486,10 +5473,8 @@ get_varp(struct vimoption *p)
#endif
case PV_UL: return curbuf->b_p_ul != NO_LOCAL_UNDOLEVEL
? (char_u *)&(curbuf->b_p_ul) : p->var;
#ifdef FEAT_LISP
case PV_LW: return *curbuf->b_p_lw != NUL
? (char_u *)&(curbuf->b_p_lw) : p->var;
#endif
case PV_MENC: return *curbuf->b_p_menc != NUL
? (char_u *)&(curbuf->b_p_menc) : p->var;
#ifdef FEAT_ARABIC
@@ -5567,15 +5552,11 @@ get_varp(struct vimoption *p)
case PV_BT: return (char_u *)&(curbuf->b_p_bt);
case PV_BL: return (char_u *)&(curbuf->b_p_bl);
case PV_CI: return (char_u *)&(curbuf->b_p_ci);
#ifdef FEAT_CINDENT
case PV_CIN: return (char_u *)&(curbuf->b_p_cin);
case PV_CINK: return (char_u *)&(curbuf->b_p_cink);
case PV_CINO: return (char_u *)&(curbuf->b_p_cino);
case PV_CINSD: return (char_u *)&(curbuf->b_p_cinsd);
#endif
#if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT)
case PV_CINW: return (char_u *)&(curbuf->b_p_cinw);
#endif
case PV_COM: return (char_u *)&(curbuf->b_p_com);
#ifdef FEAT_FOLDING
case PV_CMS: return (char_u *)&(curbuf->b_p_cms);
@@ -5608,7 +5589,7 @@ get_varp(struct vimoption *p)
case PV_INEX: return (char_u *)&(curbuf->b_p_inex);
# endif
#endif
#if defined(FEAT_CINDENT) && defined(FEAT_EVAL)
#if defined(FEAT_EVAL)
case PV_INDE: return (char_u *)&(curbuf->b_p_inde);
case PV_INDK: return (char_u *)&(curbuf->b_p_indk);
#endif
@@ -5618,9 +5599,7 @@ get_varp(struct vimoption *p)
#ifdef FEAT_CRYPT
case PV_KEY: return (char_u *)&(curbuf->b_p_key);
#endif
#ifdef FEAT_LISP
case PV_LISP: return (char_u *)&(curbuf->b_p_lisp);
#endif
case PV_ML: return (char_u *)&(curbuf->b_p_ml);
case PV_MPS: return (char_u *)&(curbuf->b_p_mps);
#ifdef FEAT_GUI_MACVIM
@@ -5634,9 +5613,7 @@ get_varp(struct vimoption *p)
case PV_QE: return (char_u *)&(curbuf->b_p_qe);
#endif
case PV_RO: return (char_u *)&(curbuf->b_p_ro);
#ifdef FEAT_SMARTINDENT
case PV_SI: return (char_u *)&(curbuf->b_p_si);
#endif
case PV_SN: return (char_u *)&(curbuf->b_p_sn);
case PV_STS: return (char_u *)&(curbuf->b_p_sts);
#ifdef FEAT_SEARCHPATH
@@ -6133,13 +6110,11 @@ buf_copy_options(buf_T *buf, int flags)
COPY_OPT_SCTX(buf, BV_NF);
buf->b_p_mps = vim_strsave(p_mps);
COPY_OPT_SCTX(buf, BV_MPS);
#ifdef FEAT_SMARTINDENT
buf->b_p_si = p_si;
COPY_OPT_SCTX(buf, BV_SI);
#endif
buf->b_p_ci = p_ci;
COPY_OPT_SCTX(buf, BV_CI);
#ifdef FEAT_CINDENT
buf->b_p_cin = p_cin;
COPY_OPT_SCTX(buf, BV_CIN);
buf->b_p_cink = vim_strsave(p_cink);
@@ -6148,19 +6123,15 @@ buf_copy_options(buf_T *buf, int flags)
COPY_OPT_SCTX(buf, BV_CINO);
buf->b_p_cinsd = vim_strsave(p_cinsd);
COPY_OPT_SCTX(buf, BV_CINSD);
#endif
// Don't copy 'filetype', it must be detected
buf->b_p_ft = empty_option;
buf->b_p_pi = p_pi;
COPY_OPT_SCTX(buf, BV_PI);
#if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT)
buf->b_p_cinw = vim_strsave(p_cinw);
COPY_OPT_SCTX(buf, BV_CINW);
#endif
#ifdef FEAT_LISP
buf->b_p_lisp = p_lisp;
COPY_OPT_SCTX(buf, BV_LISP);
#endif
#ifdef FEAT_SYN_HL
// Don't copy 'syntax', it must be set
buf->b_p_syn = empty_option;
@@ -6179,7 +6150,7 @@ buf_copy_options(buf_T *buf, int flags)
buf->b_s.b_p_spo = vim_strsave(p_spo);
COPY_OPT_SCTX(buf, BV_SPO);
#endif
#if defined(FEAT_CINDENT) && defined(FEAT_EVAL)
#if defined(FEAT_EVAL)
buf->b_p_inde = vim_strsave(p_inde);
COPY_OPT_SCTX(buf, BV_INDE);
buf->b_p_indk = vim_strsave(p_indk);
@@ -6261,9 +6232,7 @@ buf_copy_options(buf_T *buf, int flags)
buf->b_p_udf = p_udf;
COPY_OPT_SCTX(buf, BV_UDF);
#endif
#ifdef FEAT_LISP
buf->b_p_lw = empty_option;
#endif
buf->b_p_menc = empty_option;
/*
+2 -20
View File
@@ -398,14 +398,10 @@ EXTERN int p_ai; // 'autoindent'
EXTERN int p_bin; // 'binary'
EXTERN int p_bomb; // 'bomb'
EXTERN int p_bl; // 'buflisted'
#ifdef FEAT_CINDENT
EXTERN int p_cin; // 'cindent'
EXTERN char_u *p_cink; // 'cinkeys'
EXTERN char_u *p_cinsd; // 'cinscopedecls'
#endif
#if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT)
EXTERN char_u *p_cinw; // 'cinwords'
#endif
#ifdef FEAT_COMPL_FUNC
EXTERN char_u *p_cfu; // 'completefunc'
EXTERN char_u *p_ofu; // 'omnifunc'
@@ -491,9 +487,7 @@ EXTERN int p_deco; // 'delcombine'
EXTERN char_u *p_ccv; // 'charconvert'
#endif
EXTERN int p_cdh; // 'cdhome'
#ifdef FEAT_CINDENT
EXTERN char_u *p_cino; // 'cinoptions'
#endif
#ifdef FEAT_CMDWIN
EXTERN char_u *p_cedit; // 'cedit'
EXTERN long p_cwh; // 'cmdwinheight'
@@ -700,7 +694,7 @@ EXTERN int p_inf; // 'infercase'
EXTERN char_u *p_inex; // 'includeexpr'
#endif
EXTERN int p_is; // 'incsearch'
#if defined(FEAT_CINDENT) && defined(FEAT_EVAL)
#if defined(FEAT_EVAL)
EXTERN char_u *p_inde; // 'indentexpr'
EXTERN char_u *p_indk; // 'indentkeys'
#endif
@@ -729,10 +723,8 @@ EXTERN char_u *p_lm; // 'langmenu'
#ifdef FEAT_GUI
EXTERN long p_linespace; // 'linespace'
#endif
#ifdef FEAT_LISP
EXTERN int p_lisp; // 'lisp'
EXTERN char_u *p_lispwords; // 'lispwords'
#endif
EXTERN long p_ls; // 'laststatus'
EXTERN long p_stal; // 'showtabline'
EXTERN char_u *p_lcs; // 'listchars'
@@ -936,9 +928,7 @@ EXTERN int p_smd; // 'showmode'
EXTERN long p_ss; // 'sidescroll'
EXTERN long p_siso; // 'sidescrolloff'
EXTERN int p_scs; // 'smartcase'
#ifdef FEAT_SMARTINDENT
EXTERN int p_si; // 'smartindent'
#endif
EXTERN int p_sta; // 'smarttab'
EXTERN long p_sts; // 'softtabstop'
EXTERN int p_sb; // 'splitbelow'
@@ -1151,15 +1141,11 @@ enum
, BV_BL
, BV_BOMB
, BV_CI
#ifdef FEAT_CINDENT
, BV_CIN
, BV_CINK
, BV_CINO
, BV_CINSD
#endif
#if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT)
, BV_CINW
#endif
, BV_CM
#ifdef FEAT_FOLDING
, BV_CMS
@@ -1194,7 +1180,7 @@ enum
, BV_FT
, BV_IMI
, BV_IMS
#if defined(FEAT_CINDENT) && defined(FEAT_EVAL)
#if defined(FEAT_EVAL)
, BV_INDE
, BV_INDK
#endif
@@ -1210,10 +1196,8 @@ enum
, BV_KMAP
#endif
, BV_KP
#ifdef FEAT_LISP
, BV_LISP
, BV_LW
#endif
, BV_MENC
, BV_MA
, BV_ML
@@ -1232,9 +1216,7 @@ enum
, BV_QE
#endif
, BV_RO
#ifdef FEAT_SMARTINDENT
, BV_SI
#endif
, BV_SN
#ifdef FEAT_SYN_HL
, BV_SMC
+13 -59
View File
@@ -40,15 +40,11 @@
#define PV_BL OPT_BUF(BV_BL)
#define PV_BOMB OPT_BUF(BV_BOMB)
#define PV_CI OPT_BUF(BV_CI)
#ifdef FEAT_CINDENT
# define PV_CIN OPT_BUF(BV_CIN)
# define PV_CINK OPT_BUF(BV_CINK)
# define PV_CINO OPT_BUF(BV_CINO)
# define PV_CINSD OPT_BUF(BV_CINSD)
#endif
#if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT)
# define PV_CINW OPT_BUF(BV_CINW)
#endif
#define PV_CIN OPT_BUF(BV_CIN)
#define PV_CINK OPT_BUF(BV_CINK)
#define PV_CINO OPT_BUF(BV_CINO)
#define PV_CINSD OPT_BUF(BV_CINSD)
#define PV_CINW OPT_BUF(BV_CINW)
#define PV_CM OPT_BOTH(OPT_BUF(BV_CM))
#ifdef FEAT_FOLDING
# define PV_CMS OPT_BUF(BV_CMS)
@@ -83,7 +79,7 @@
#define PV_FT OPT_BUF(BV_FT)
#define PV_IMI OPT_BUF(BV_IMI)
#define PV_IMS OPT_BUF(BV_IMS)
#if defined(FEAT_CINDENT) && defined(FEAT_EVAL)
#if defined(FEAT_EVAL)
# define PV_INDE OPT_BUF(BV_INDE)
# define PV_INDK OPT_BUF(BV_INDK)
#endif
@@ -99,10 +95,8 @@
# define PV_KMAP OPT_BUF(BV_KMAP)
#endif
#define PV_KP OPT_BOTH(OPT_BUF(BV_KP))
#ifdef FEAT_LISP
# define PV_LISP OPT_BUF(BV_LISP)
# define PV_LW OPT_BOTH(OPT_BUF(BV_LW))
#endif
#define PV_LISP OPT_BUF(BV_LISP)
#define PV_LW OPT_BOTH(OPT_BUF(BV_LW))
#define PV_MENC OPT_BOTH(OPT_BUF(BV_MENC))
#define PV_MA OPT_BUF(BV_MA)
#define PV_ML OPT_BUF(BV_ML)
@@ -121,9 +115,7 @@
# define PV_QE OPT_BUF(BV_QE)
#endif
#define PV_RO OPT_BUF(BV_RO)
#ifdef FEAT_SMARTINDENT
# define PV_SI OPT_BUF(BV_SI)
#endif
#define PV_SI OPT_BUF(BV_SI)
#define PV_SN OPT_BUF(BV_SN)
#ifdef FEAT_SYN_HL
# define PV_SMC OPT_BUF(BV_SMC)
@@ -630,46 +622,22 @@ static struct vimoption options[] =
#endif
SCTX_INIT},
{"cindent", "cin", P_BOOL|P_VI_DEF|P_VIM,
#ifdef FEAT_CINDENT
(char_u *)&p_cin, PV_CIN,
#else
(char_u *)NULL, PV_NONE,
#endif
{(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
{"cinkeys", "cink", P_STRING|P_ALLOCED|P_VI_DEF|P_ONECOMMA|P_NODUP,
#ifdef FEAT_CINDENT
(char_u *)&p_cink, PV_CINK,
{INDENTKEYS_DEFAULT, (char_u *)0L}
#else
(char_u *)NULL, PV_NONE,
{(char_u *)0L, (char_u *)0L}
#endif
SCTX_INIT},
{INDENTKEYS_DEFAULT, (char_u *)0L} SCTX_INIT},
{"cinoptions", "cino", P_STRING|P_ALLOCED|P_VI_DEF|P_ONECOMMA|P_NODUP,
#ifdef FEAT_CINDENT
(char_u *)&p_cino, PV_CINO,
#else
(char_u *)NULL, PV_NONE,
#endif
{(char_u *)"", (char_u *)0L} SCTX_INIT},
{"cinscopedecls", "cinsd", P_STRING|P_ALLOCED|P_VI_DEF|P_ONECOMMA|P_NODUP,
#ifdef FEAT_CINDENT
(char_u *)&p_cinsd, PV_CINSD,
{(char_u *)"public,protected,private", (char_u *)0L}
#else
(char_u *)NULL, PV_NONE,
{(char_u *)0L, (char_u *)0L}
#endif
SCTX_INIT},
{"cinwords", "cinw", P_STRING|P_ALLOCED|P_VI_DEF|P_ONECOMMA|P_NODUP,
#if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT)
(char_u *)&p_cinw, PV_CINW,
{(char_u *)"if,else,while,do,for,switch",
(char_u *)0L}
#else
(char_u *)NULL, PV_NONE,
{(char_u *)0L, (char_u *)0L}
#endif
SCTX_INIT},
{"clipboard", "cb", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP,
#ifdef FEAT_CLIPBOARD
@@ -1491,7 +1459,7 @@ static struct vimoption options[] =
(char_u *)&p_is, PV_NONE,
{(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
{"indentexpr", "inde", P_STRING|P_ALLOCED|P_VI_DEF|P_VIM|P_MLE,
#if defined(FEAT_CINDENT) && defined(FEAT_EVAL)
#if defined(FEAT_EVAL)
(char_u *)&p_inde, PV_INDE,
{(char_u *)"", (char_u *)0L}
#else
@@ -1500,7 +1468,7 @@ static struct vimoption options[] =
#endif
SCTX_INIT},
{"indentkeys", "indk", P_STRING|P_ALLOCED|P_VI_DEF|P_ONECOMMA|P_NODUP,
#if defined(FEAT_CINDENT) && defined(FEAT_EVAL)
#if defined(FEAT_EVAL)
(char_u *)&p_indk, PV_INDK,
{INDENTKEYS_DEFAULT, (char_u *)0L}
#else
@@ -1661,21 +1629,11 @@ static struct vimoption options[] =
#endif
SCTX_INIT},
{"lisp", NULL, P_BOOL|P_VI_DEF,
#ifdef FEAT_LISP
(char_u *)&p_lisp, PV_LISP,
#else
(char_u *)NULL, PV_NONE,
#endif
{(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
{"lispwords", "lw", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP,
#ifdef FEAT_LISP
(char_u *)&p_lispwords, PV_LW,
{(char_u *)LISPWORD_VALUE, (char_u *)0L}
#else
(char_u *)NULL, PV_NONE,
{(char_u *)"", (char_u *)0L}
#endif
SCTX_INIT},
{(char_u *)LISPWORD_VALUE, (char_u *)0L} SCTX_INIT},
{"list", NULL, P_BOOL|P_VI_DEF|P_RWIN,
(char_u *)VAR_WIN, PV_LIST,
{(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
@@ -2454,11 +2412,7 @@ static struct vimoption options[] =
(char_u *)&p_scs, PV_NONE,
{(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
{"smartindent", "si", P_BOOL|P_VI_DEF|P_VIM,
#ifdef FEAT_SMARTINDENT
(char_u *)&p_si, PV_SI,
#else
(char_u *)NULL, PV_NONE,
#endif
{(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
{"smarttab", "sta", P_BOOL|P_VI_DEF|P_VIM,
(char_u *)&p_sta, PV_NONE,
+1 -13
View File
@@ -215,7 +215,7 @@ check_buf_options(buf_T *buf)
check_string_option(&buf->b_p_inex);
# endif
#endif
#if defined(FEAT_CINDENT) && defined(FEAT_EVAL)
#if defined(FEAT_EVAL)
check_string_option(&buf->b_p_inde);
check_string_option(&buf->b_p_indk);
#endif
@@ -258,16 +258,12 @@ check_buf_options(buf_T *buf)
#ifdef FEAT_SEARCHPATH
check_string_option(&buf->b_p_sua);
#endif
#ifdef FEAT_CINDENT
check_string_option(&buf->b_p_cink);
check_string_option(&buf->b_p_cino);
check_string_option(&buf->b_p_cinsd);
parse_cino(buf);
#endif
check_string_option(&buf->b_p_ft);
#if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT)
check_string_option(&buf->b_p_cinw);
#endif
check_string_option(&buf->b_p_cpt);
#ifdef FEAT_COMPL_FUNC
check_string_option(&buf->b_p_cfu);
@@ -291,9 +287,7 @@ check_buf_options(buf_T *buf)
check_string_option(&buf->b_p_tc);
check_string_option(&buf->b_p_dict);
check_string_option(&buf->b_p_tsr);
#ifdef FEAT_LISP
check_string_option(&buf->b_p_lw);
#endif
check_string_option(&buf->b_p_bkc);
check_string_option(&buf->b_p_menc);
#ifdef FEAT_VARTABS
@@ -2135,14 +2129,12 @@ ambw_end:
}
#endif
#ifdef FEAT_CINDENT
// 'cinoptions'
else if (gvarp == &p_cino)
{
// TODO: recognize errors
parse_cino(curbuf);
}
#endif
#if defined(FEAT_RENDER_OPTIONS)
// 'renderoptions'
@@ -2334,9 +2326,7 @@ ambw_end:
# ifdef FEAT_FIND_ID
gvarp == &p_inex ||
# endif
# ifdef FEAT_CINDENT
gvarp == &p_inde ||
# endif
# ifdef FEAT_DIFF
varp == &p_pex ||
# endif
@@ -2370,10 +2360,8 @@ ambw_end:
if (gvarp == &p_inex) // 'includeexpr'
p_opt = &curbuf->b_p_inex;
# endif
# ifdef FEAT_CINDENT
if (gvarp == &p_inde) // 'indentexpr'
p_opt = &curbuf->b_p_inde;
# endif
# ifdef FEAT_DIFF
if (varp == &p_pex) // 'patchexpr'
p_opt = &p_pex;
+1 -2
View File
@@ -26,8 +26,7 @@ msgstr ""
"POT-Creation-Date: 2022-05-11 17:36+1000\n"
"PO-Revision-Date: 2022-05-12 10:05+1000\n"
"Last-Translator: Doug Kearns <dougkearns@gmail.com>\n"
"Language-Team: Mike Williams <mrw@eandem.co.uk>, Doug Kearns "
"<dougkearns@gmail.com>\n"
"Language-Team: Mike Williams <mrw@eandem.co.uk>\n"
"Language: en_GB\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=ISO-8859-1\n"
+8516 -4334
View File
File diff suppressed because it is too large Load Diff
+112 -244
View File
File diff suppressed because it is too large Load Diff
-1
View File
@@ -26,7 +26,6 @@ Comment[da]=Rediger tekstfiler
Comment[el]=Επεξεργασία αρχείων κειμένου
Comment[en_CA]=Edit text files
Comment[en_GB]=Edit text files
Comment[es]=Edita archivos de texto
Comment[et]=Redigeeri tekstifaile
Comment[eu]=Editatu testu-fitxategiak
Comment[fa]=ویرایش پرونده‌های متنی
-1
View File
@@ -26,7 +26,6 @@ Comment[da]=Rediger tekstfiler
Comment[el]=Επεξεργασία αρχείων κειμένου
Comment[en_CA]=Edit text files
Comment[en_GB]=Edit text files
Comment[es]=Edita archivos de texto
Comment[et]=Redigeeri tekstifaile
Comment[eu]=Editatu testu-fitxategiak
Comment[fa]=ویرایش پرونده‌های متنی
+1
View File
@@ -84,6 +84,7 @@ void show_termcodes(int flags);
int show_one_termcode(char_u *name, char_u *code, int printit);
void update_tcap(int attr);
void swap_tcap(void);
void ansi_color2rgb(int nr, char_u *r, char_u *g, char_u *b, char_u *ansi_idx);
void cterm_color2rgb(int nr, char_u *r, char_u *g, char_u *b, char_u *ansi_idx);
void term_replace_bs_del_keycode(char_u *ta_buf, int ta_len, int len);
/* vim: set ft=c : */
+1
View File
@@ -34,6 +34,7 @@ int term_get_attr(win_T *wp, linenr_T lnum, int col);
void term_reset_wincolor(win_T *wp);
void term_update_wincolor(win_T *wp);
void term_update_wincolor_all(void);
void term_update_palette_all(void);
void term_update_colors_all(void);
char_u *term_get_status_text(term_T *term);
void term_clear_status_text(term_T *term);
+1
View File
@@ -45,6 +45,7 @@ char_u *save_function_name(char_u **name, int *is_global, int skip, int flags, f
void list_functions(regmatch_T *regmatch);
ufunc_T *define_function(exarg_T *eap, char_u *name_arg, garray_T *lines_to_free);
void ex_function(exarg_T *eap);
ufunc_T *find_func_by_name(char_u *name, compiletype_T *compile_type);
void ex_defcompile(exarg_T *eap);
int eval_fname_script(char_u *p);
int translated_function_exists(char_u *name, int is_global);
-2
View File
@@ -2154,11 +2154,9 @@ do_put(
ptr = ml_get(lnum);
if (cnt == count && i == y_size - 1)
lendiff = (int)STRLEN(ptr);
#if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT)
if (*ptr == '#' && preprocs_left())
indent = 0; // Leave # lines at start
else
#endif
if (*ptr == NUL)
indent = 0; // Ignore empty lines
else if (first_indent)
+15 -45
View File
@@ -2125,10 +2125,8 @@ findmatchlimit(
int match_escaped = 0; // search for escaped match
int dir; // Direction to search
int comment_col = MAXCOL; // start of / / comment
#ifdef FEAT_LISP
int lispcomm = FALSE; // inside of Lisp-style comment
int lisp = curbuf->b_p_lisp; // engage Lisp-specific hacks ;)
#endif
pos = curwin->w_cursor;
pos.coladd = 0;
@@ -2357,16 +2355,11 @@ findmatchlimit(
CLEAR_POS(&match_pos);
// backward search: Check if this line contains a single-line comment
if ((backwards && comment_dir)
#ifdef FEAT_LISP
|| lisp
#endif
)
if ((backwards && comment_dir) || lisp)
comment_col = check_linecomment(linep);
#ifdef FEAT_LISP
if (lisp && comment_col != MAXCOL && pos.col > (colnr_T)comment_col)
lispcomm = TRUE; // find match inside this comment
#endif
while (!got_int)
{
/*
@@ -2375,11 +2368,9 @@ findmatchlimit(
*/
if (backwards)
{
#ifdef FEAT_LISP
// char to match is inside of comment, don't search outside
if (lispcomm && pos.col < (colnr_T)comment_col)
break;
#endif
if (pos.col == 0) // at start of line, go to prev. one
{
if (pos.lnum == 1) // start of file
@@ -2395,17 +2386,11 @@ findmatchlimit(
line_breakcheck();
// Check if this line contains a single-line comment
if (comment_dir
#ifdef FEAT_LISP
|| lisp
#endif
)
if (comment_dir || lisp)
comment_col = check_linecomment(linep);
#ifdef FEAT_LISP
// skip comment
if (lisp && comment_col != MAXCOL)
pos.col = comment_col;
#endif
}
else
{
@@ -2418,20 +2403,14 @@ findmatchlimit(
{
if (linep[pos.col] == NUL
// at end of line, go to next one
#ifdef FEAT_LISP
// don't search for match in comment
// For lisp don't search for match in comment
|| (lisp && comment_col != MAXCOL
&& pos.col == (colnr_T)comment_col)
#endif
)
&& pos.col == (colnr_T)comment_col))
{
if (pos.lnum == curbuf->b_ml.ml_line_count // end of file
#ifdef FEAT_LISP
// line is exhausted and comment with it,
// don't search for match in code
|| lispcomm
#endif
)
|| lispcomm)
break;
++pos.lnum;
@@ -2442,10 +2421,8 @@ findmatchlimit(
pos.col = 0;
do_quotes = -1;
line_breakcheck();
#ifdef FEAT_LISP
if (lisp) // find comment pos in new line
comment_col = check_linecomment(linep);
#endif
}
else
{
@@ -2688,7 +2665,6 @@ findmatchlimit(
// FALLTHROUGH
default:
#ifdef FEAT_LISP
/*
* For Lisp skip over backslashed (), {} and [].
* (actually, we skip #\( et al)
@@ -2699,7 +2675,6 @@ findmatchlimit(
&& check_prevcol(linep, pos.col, '\\', NULL)
&& check_prevcol(linep, pos.col - 1, '#', NULL))
break;
#endif
// Check for match outside of quotes, and inside of
// quotes when the start is also inside of quotes.
@@ -2748,7 +2723,6 @@ check_linecomment(char_u *line)
char_u *p;
p = line;
#ifdef FEAT_LISP
// skip Lispish one-line comments
if (curbuf->b_p_lisp)
{
@@ -2782,17 +2756,16 @@ check_linecomment(char_u *line)
p = NULL;
}
else
#endif
while ((p = vim_strchr(p, '/')) != NULL)
{
// Accept a double /, unless it's preceded with * and followed by *,
// because * / / * is an end and start of a C comment.
// Only accept the position if it is not inside a string.
if (p[1] == '/' && (p == line || p[-1] != '*' || p[2] != '*')
while ((p = vim_strchr(p, '/')) != NULL)
{
// Accept a double /, unless it's preceded with * and followed by
// *, because * / / * is an end and start of a C comment. Only
// accept the position if it is not inside a string.
if (p[1] == '/' && (p == line || p[-1] != '*' || p[2] != '*')
&& !is_pos_in_string(line, (colnr_T)(p - line)))
break;
++p;
}
break;
++p;
}
if (p == NULL)
return MAXCOL;
@@ -3126,8 +3099,6 @@ current_search(
return OK;
}
#if defined(FEAT_LISP) || defined(FEAT_CINDENT) || defined(FEAT_TEXTOBJ) \
|| defined(PROTO)
/*
* return TRUE if line 'lnum' is empty or has white chars only.
*/
@@ -3139,7 +3110,6 @@ linewhite(linenr_T lnum)
p = skipwhite(ml_get(lnum));
return (*p == NUL);
}
#endif
/*
* Add the search count "[3/19]" to "msgbuf".
+1 -1
View File
@@ -253,7 +253,7 @@ spell_check(
MAXWLEN + 1);
mi.mi_fwordlen = (int)STRLEN(mi.mi_fword);
if (camel_case)
if (camel_case && mi.mi_fwordlen > 0)
// Introduce a fake word end space into the folded word.
mi.mi_fword[mi.mi_fwordlen - 1] = ' ';
+1 -13
View File
@@ -2882,15 +2882,11 @@ struct file_buffer
int b_has_qf_entry;
#endif
int b_p_bl; // 'buflisted'
#ifdef FEAT_CINDENT
int b_p_cin; // 'cindent'
char_u *b_p_cino; // 'cinoptions'
char_u *b_p_cink; // 'cinkeys'
char_u *b_p_cinsd; // 'cinscopedecls'
#endif
#if defined(FEAT_CINDENT) || defined(FEAT_SMARTINDENT)
char_u *b_p_cinw; // 'cinwords'
#endif
char_u *b_p_com; // 'comments'
#ifdef FEAT_FOLDING
char_u *b_p_cms; // 'commentstring'
@@ -2929,7 +2925,7 @@ struct file_buffer
long_u b_p_inex_flags; // flags for 'includeexpr'
# endif
#endif
#if defined(FEAT_CINDENT) && defined(FEAT_EVAL)
#if defined(FEAT_EVAL)
char_u *b_p_inde; // 'indentexpr'
long_u b_p_inde_flags; // flags for 'indentexpr'
char_u *b_p_indk; // 'indentkeys'
@@ -2943,9 +2939,7 @@ struct file_buffer
char_u *b_p_key; // 'key'
#endif
char_u *b_p_kp; // 'keywordprg'
#ifdef FEAT_LISP
int b_p_lisp; // 'lisp'
#endif
char_u *b_p_menc; // 'makeencoding'
char_u *b_p_mps; // 'matchpairs'
int b_p_ml; // 'modeline'
@@ -2959,9 +2953,7 @@ struct file_buffer
int b_p_ro; // 'readonly'
long b_p_sw; // 'shiftwidth'
int b_p_sn; // 'shortname'
#ifdef FEAT_SMARTINDENT
int b_p_si; // 'smartindent'
#endif
long b_p_sts; // 'softtabstop'
long b_p_sts_nopaste; // b_p_sts saved for paste mode
#ifdef FEAT_SEARCHPATH
@@ -3018,9 +3010,7 @@ struct file_buffer
#ifdef FEAT_GUI_MACVIM
int b_p_mmta; /* 'macmeta' local value */
#endif
#ifdef FEAT_LISP
char_u *b_p_lw; // 'lispwords' local value
#endif
#ifdef FEAT_TERMINAL
long b_p_twsl; // 'termwinscroll'
#endif
@@ -3029,7 +3019,6 @@ struct file_buffer
* end of buffer options
*/
#ifdef FEAT_CINDENT
// values set from b_p_cino
int b_ind_level;
int b_ind_open_imag;
@@ -3068,7 +3057,6 @@ struct file_buffer
int b_ind_if_for_while;
int b_ind_cpp_extern_c;
int b_ind_pragma;
#endif
linenr_T b_no_eol_lnum; // non-zero lnum when last line of next binary
// write should not have an end-of-line
+20 -1
View File
@@ -6736,7 +6736,7 @@ static int grey_ramp[] = {
0x80, 0x8A, 0x94, 0x9E, 0xA8, 0xB2, 0xBC, 0xC6, 0xD0, 0xDA, 0xE4, 0xEE
};
static char_u ansi_table[16][3] = {
static const char_u ansi_table[16][3] = {
// R G B
{ 0, 0, 0}, // black
{224, 0, 0}, // dark red
@@ -6766,6 +6766,25 @@ static const char_u cterm_ansi_idx[] = {
#define ANSI_INDEX_NONE 0
void
ansi_color2rgb(int nr, char_u *r, char_u *g, char_u *b, char_u *ansi_idx)
{
if (nr < 16)
{
*r = ansi_table[nr][0];
*g = ansi_table[nr][1];
*b = ansi_table[nr][2];
*ansi_idx = nr;
}
else
{
*r = 0;
*g = 0;
*b = 0;
*ansi_idx = ANSI_INDEX_NONE;
}
}
void
cterm_color2rgb(int nr, char_u *r, char_u *g, char_u *b, char_u *ansi_idx)
{
+163 -44
View File
@@ -162,6 +162,8 @@ struct terminal_S {
int tl_cursor_shape; // 1: block, 2: underline, 3: bar
char_u *tl_cursor_color; // NULL or allocated
long_u *tl_palette; // array of 16 colors specified by term_start, can
// be NULL
int tl_using_altscreen;
garray_T tl_osc_buf; // incomplete OSC string
};
@@ -242,6 +244,25 @@ cursor_color_get(char_u *color)
return (color == NULL) ? (char_u *)"" : color;
}
/*
* Return TRUE if the user-defined palette (either g:terminal_ansi_colors or the
* "ansi_colors" argument in term_start()) shall be applied.
*/
static int
term_use_palette()
{
if (0
#ifdef FEAT_GUI
|| gui.in_use
#endif
#ifdef FEAT_TERMGUICOLORS
|| p_tgc
#endif
)
return TRUE;
return FALSE;
}
/*
* Parse 'termwinsize' and set "rows" and "cols" for the terminal size in the
@@ -705,6 +726,18 @@ term_start(
if (opt->jo_set2 & JO2_TERM_HIGHLIGHT)
term->tl_highlight_name = vim_strsave(opt->jo_term_highlight);
// Save the user-defined palette, it is only used in GUI (or 'tgc' is on).
if (opt->jo_set2 & JO2_ANSI_COLORS)
{
term->tl_palette = ALLOC_MULT(long_u, 16);
if (term->tl_palette == NULL)
{
vim_free(term);
return NULL;
}
memcpy(term->tl_palette, opt->jo_ansi_colors, sizeof(long_u) * 16);
}
// System dependent: setup the vterm and maybe start the job in it.
if (argv == NULL
&& argvar->v_type == VAR_STRING
@@ -1118,6 +1151,7 @@ free_unused_terminals()
#endif
vim_free(term->tl_highlight_name);
vim_free(term->tl_cursor_color);
vim_free(term->tl_palette);
vim_free(term);
}
}
@@ -2800,31 +2834,24 @@ color2index(VTermColor *color, int fg, int *boldp)
int blue = color->blue;
int green = color->green;
*boldp = FALSE;
if (VTERM_COLOR_IS_INVALID(color))
return 0;
if (VTERM_COLOR_IS_INDEXED(color))
{
// The first 16 colors and default: use the ANSI index.
switch (color->index + 1)
// Use the color as-is if possible, give up otherwise.
if (color->index < t_colors)
return color->index + 1;
// 8-color terminals can actually display twice as many colors by
// setting the high-intensity/bold bit.
else if (t_colors == 8 && fg && color->index < 16)
{
case 0: return 0;
case 1: return lookup_color( 0, fg, boldp) + 1; // black
case 2: return lookup_color( 4, fg, boldp) + 1; // dark red
case 3: return lookup_color( 2, fg, boldp) + 1; // dark green
case 4: return lookup_color( 7, fg, boldp) + 1; // dark yellow
case 5: return lookup_color( 1, fg, boldp) + 1; // dark blue
case 6: return lookup_color( 5, fg, boldp) + 1; // dark magenta
case 7: return lookup_color( 3, fg, boldp) + 1; // dark cyan
case 8: return lookup_color( 8, fg, boldp) + 1; // light grey
case 9: return lookup_color(12, fg, boldp) + 1; // dark grey
case 10: return lookup_color(20, fg, boldp) + 1; // red
case 11: return lookup_color(16, fg, boldp) + 1; // green
case 12: return lookup_color(24, fg, boldp) + 1; // yellow
case 13: return lookup_color(14, fg, boldp) + 1; // blue
case 14: return lookup_color(22, fg, boldp) + 1; // magenta
case 15: return lookup_color(18, fg, boldp) + 1; // cyan
case 16: return lookup_color(26, fg, boldp) + 1; // white
*boldp = TRUE;
return (color->index & 7) + 1;
}
return 0;
}
if (t_colors >= 256)
@@ -4256,11 +4283,13 @@ init_vterm_ansi_colors(VTerm *vterm)
{
dictitem_T *var = find_var((char_u *)"g:terminal_ansi_colors", NULL, TRUE);
if (var != NULL
&& (var->di_tv.v_type != VAR_LIST
|| var->di_tv.vval.v_list == NULL
|| var->di_tv.vval.v_list->lv_first == &range_list_item
|| set_ansi_colors_list(vterm, var->di_tv.vval.v_list) == FAIL))
if (var == NULL)
return;
if (var->di_tv.v_type != VAR_LIST
|| var->di_tv.vval.v_list == NULL
|| var->di_tv.vval.v_list->lv_first == &range_list_item
|| set_ansi_colors_list(vterm, var->di_tv.vval.v_list) == FAIL)
semsg(_(e_invalid_argument_str), "g:terminal_ansi_colors");
}
#endif
@@ -4694,6 +4723,62 @@ create_vterm(term_T *term, int rows, int cols)
return OK;
}
/*
* Reset the terminal palette to its default value.
*/
static void
term_reset_palette(VTerm *vterm)
{
VTermState *state = vterm_obtain_state(vterm);
int index;
for (index = 0; index < 16; index++)
{
VTermColor color;
color.type = VTERM_COLOR_INDEXED;
ansi_color2rgb(index, &color.red, &color.green, &color.blue,
&color.index);
// The first valid index starts at 1.
color.index -= 1;
vterm_state_set_palette_color(state, index, &color);
}
}
static void
term_update_palette(term_T *term)
{
if (term_use_palette()
&& (term->tl_palette != NULL
|| find_var((char_u *)"g:terminal_ansi_colors", NULL, TRUE)
!= NULL))
{
if (term->tl_palette != NULL)
set_vterm_palette(term->tl_vterm, term->tl_palette);
else
init_vterm_ansi_colors(term->tl_vterm);
}
else
term_reset_palette(term->tl_vterm);
}
/*
* Called when option 'termguicolors' is changed.
*/
void
term_update_palette_all()
{
term_T *term;
FOR_ALL_TERMS(term)
{
if (term->tl_vterm == NULL)
continue;
term_update_palette(term);
}
}
/*
* Called when option 'background' or 'termguicolors' was set,
* or when any highlight is changed.
@@ -6351,6 +6436,8 @@ f_term_setansicolors(typval_T *argvars, typval_T *rettv UNUSED)
{
buf_T *buf;
term_T *term;
listitem_T *li;
int n = 0;
if (in_vim9script()
&& (check_for_buffer_arg(argvars, 0) == FAIL
@@ -6369,9 +6456,38 @@ f_term_setansicolors(typval_T *argvars, typval_T *rettv UNUSED)
emsg(_(e_list_required));
return;
}
if (set_ansi_colors_list(term->tl_vterm, argvars[1].vval.v_list) == FAIL)
if (argvars[1].vval.v_list->lv_first == &range_list_item
|| argvars[1].vval.v_list->lv_len != 16)
{
emsg(_(e_invalid_argument));
return;
}
if (term->tl_palette == NULL)
term->tl_palette = ALLOC_MULT(long_u, 16);
if (term->tl_palette == NULL)
return;
FOR_ALL_LIST_ITEMS(argvars[1].vval.v_list, li)
{
char_u *color_name;
guicolor_T guicolor;
color_name = tv_get_string_chk(&li->li_tv);
if (color_name == NULL)
return;
guicolor = GUI_GET_COLOR(color_name);
if (guicolor == INVALCOLOR)
{
semsg(_(e_cannot_allocate_color_str), color_name);
return;
}
term->tl_palette[n++] = GUI_MCH_GET_RGB(guicolor);
}
term_update_palette(term);
}
#endif
@@ -6828,12 +6944,13 @@ conpty_term_and_job_init(
if (create_vterm(term, term->tl_rows, term->tl_cols) == FAIL)
goto failed;
#if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)
if (opt->jo_set2 & JO2_ANSI_COLORS)
set_vterm_palette(term->tl_vterm, opt->jo_ansi_colors);
else
init_vterm_ansi_colors(term->tl_vterm);
#endif
if (term_use_palette())
{
if (term->tl_palette != NULL)
set_vterm_palette(term->tl_vterm, term->tl_palette);
else
init_vterm_ansi_colors(term->tl_vterm);
}
channel_set_job(channel, job, opt);
job_set_options(job, opt);
@@ -7159,12 +7276,13 @@ winpty_term_and_job_init(
if (create_vterm(term, term->tl_rows, term->tl_cols) == FAIL)
goto failed;
#if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)
if (opt->jo_set2 & JO2_ANSI_COLORS)
set_vterm_palette(term->tl_vterm, opt->jo_ansi_colors);
else
init_vterm_ansi_colors(term->tl_vterm);
#endif
if (term_use_palette())
{
if (term->tl_palette != NULL)
set_vterm_palette(term->tl_vterm, term->tl_palette);
else
init_vterm_ansi_colors(term->tl_vterm);
}
channel_set_job(channel, job, opt);
job_set_options(job, opt);
@@ -7418,12 +7536,13 @@ term_and_job_init(
if (create_vterm(term, term->tl_rows, term->tl_cols) == FAIL)
return FAIL;
#if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)
if (opt->jo_set2 & JO2_ANSI_COLORS)
set_vterm_palette(term->tl_vterm, opt->jo_ansi_colors);
else
init_vterm_ansi_colors(term->tl_vterm);
#endif
if (term_use_palette())
{
if (term->tl_palette != NULL)
set_vterm_palette(term->tl_vterm, term->tl_palette);
else
init_vterm_ansi_colors(term->tl_vterm);
}
// This may change a string in "argvar".
term->tl_job = job_start(argvar, argv, opt, &term->tl_job);
File diff suppressed because it is too large Load Diff
+7 -9
View File
@@ -391,15 +391,13 @@ endfunc
func Test_edit_13()
" Test smartindenting
if exists("+smartindent")
new
set smartindent autoindent
call setline(1, ["\tabc"])
call feedkeys("A {\<cr>more\<cr>}\<esc>", 'tnix')
call assert_equal(["\tabc {", "\t\tmore", "\t}"], getline(1, '$'))
set smartindent& autoindent&
bwipe!
endif
new
set smartindent autoindent
call setline(1, ["\tabc"])
call feedkeys("A {\<cr>more\<cr>}\<esc>", 'tnix')
call assert_equal(["\tabc {", "\t\tmore", "\t}"], getline(1, '$'))
set smartindent& autoindent&
bwipe!
" Test autoindent removing indent of blank line.
new
+49
View File
@@ -231,6 +231,26 @@ func Test_update_folds_expr_read()
set foldmethod& foldexpr&
endfunc
" Test for what patch 8.1.0535 fixes.
func Test_foldexpr_no_interrupt_addsub()
new
func! FoldFunc()
call setpos('.', getcurpos())
return '='
endfunc
set foldmethod=expr
set foldexpr=FoldFunc()
call setline(1, '1.2')
exe "norm! $\<C-A>"
call assert_equal('1.3', getline(1))
bwipe!
delfunc FoldFunc
set foldmethod& foldexpr&
endfunc
func Check_foldlevels(expected)
call assert_equal(a:expected, map(range(1, line('$')), 'foldlevel(v:val)'))
endfunc
@@ -1479,4 +1499,33 @@ func Test_indent_append_under_blank_line()
bw!
endfunc
" Make sure that when you delete 1 line of a fold whose length is 2 lines, the
" fold can't be closed since its length (1) is now less than foldminlines.
func Test_indent_one_line_fold_close()
let lines =<< trim END
line 1
line 2
line 3
END
new
setlocal sw=2 foldmethod=indent
call setline(1, lines)
" open all folds, delete line, then close all folds
normal zR
3delete
normal zM
call assert_equal(-1, foldclosed(2)) " the fold should not be closed
" Now do the same, but delete line 2 this time; this covers different code.
" (Combining this code with the above code doesn't expose both bugs.)
1,$delete
call setline(1, lines)
normal zR
2delete
normal zM
call assert_equal(-1, foldclosed(2))
bw!
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+2 -1
View File
@@ -2679,7 +2679,8 @@ func Test_range()
else
let cmd = "ls"
endif
call assert_fails('call term_start("' .. cmd .. '", #{term_finish: "close"})', 'E475:')
call assert_fails('call term_start("' .. cmd .. '", #{term_finish: "close"'
\ .. ', ansi_colors: range(16)})', 'E475:')
unlet g:terminal_ansi_colors
endif
+12
View File
@@ -2017,10 +2017,16 @@ func Test_terminal_ansicolors_global()
CheckFeature termguicolors
CheckFunction term_getansicolors
if has('vtp') && !has('vcon') && !has('gui_running')
throw 'Skipped: does not support termguicolors'
endif
set tgc
let g:terminal_ansi_colors = reverse(copy(s:test_colors))
let buf = Run_shell_in_terminal({})
call assert_equal(g:terminal_ansi_colors, term_getansicolors(buf))
call StopShellInTerminal(buf)
set tgc&
exe buf . 'bwipe'
unlet g:terminal_ansi_colors
@@ -2030,6 +2036,11 @@ func Test_terminal_ansicolors_func()
CheckFeature termguicolors
CheckFunction term_getansicolors
if has('vtp') && !has('vcon') && !has('gui_running')
throw 'Skipped: does not support termguicolors'
endif
set tgc
let g:terminal_ansi_colors = reverse(copy(s:test_colors))
let buf = Run_shell_in_terminal({'ansi_colors': s:test_colors})
call assert_equal(s:test_colors, term_getansicolors(buf))
@@ -2052,6 +2063,7 @@ func Test_terminal_ansicolors_func()
let colors[4] = 'Invalid'
call assert_fails('call term_setansicolors(buf, colors)', 'E254:')
call assert_fails('call term_setansicolors(buf, {})', 'E714:')
set tgc&
call StopShellInTerminal(buf)
call assert_equal(0, term_setansicolors(buf, []))
+7
View File
@@ -573,6 +573,13 @@ func Test_prop_replace()
call assert_equal('yyyex xyyoxx', getline(1))
call assert_equal(expected, prop_list(1))
" Replace three 1-byte chars with three 2-byte ones.
exe "normal 0l3rø"
call assert_equal('yøøøx xyyoxx', getline(1))
let expected[0].length += 3
let expected[1].col += 3
call assert_equal(expected, prop_list(1))
call DeletePropTypes()
bwipe!
set bs&
+10
View File
@@ -83,6 +83,16 @@ def Test_vim9cmd()
v9.CheckScriptSuccess(lines)
enddef
def Test_defcompile_fails()
assert_fails('defcompile NotExists', 'E1061:')
assert_fails('defcompile debug debug Test_defcompile_fails', 'E488:')
assert_fails('defcompile profile profile Test_defcompile_fails', 'E488:')
enddef
defcompile Test_defcompile_fails
defcompile debug Test_defcompile_fails
defcompile profile Test_defcompile_fails
def Test_cmdmod_execute()
# "legacy" applies not only to the "exe" argument but also to the commands
var lines =<< trim END
+3
View File
@@ -43,6 +43,9 @@ def Test_disassemble_load()
assert_fails('disass [', 'E475:')
assert_fails('disass 234', 'E129:')
assert_fails('disass <XX>foo', 'E129:')
assert_fails('disass Test_disassemble_load burp', 'E488:')
assert_fails('disass debug debug Test_disassemble_load', 'E488:')
assert_fails('disass profile profile Test_disassemble_load', 'E488:')
var res = execute('disass s:ScriptFuncLoad')
assert_match('<SNR>\d*_ScriptFuncLoad.*' ..
+28
View File
@@ -161,4 +161,32 @@ func Test_winbar_not_visible_custom_statusline()
call delete('XtestWinbarNotVisble')
endfunction
func Test_drag_statusline_with_winbar()
call SetupWinbar()
let save_mouse = &mouse
set mouse=a
set laststatus=2
call test_setmouse(&lines - 1, 1)
call feedkeys("\<LeftMouse>", 'xt')
call test_setmouse(&lines - 2, 1)
call feedkeys("\<LeftDrag>", 'xt')
call assert_equal(2, &cmdheight)
call test_setmouse(&lines - 2, 1)
call feedkeys("\<LeftMouse>", 'xt')
call test_setmouse(&lines - 3, 1)
call feedkeys("\<LeftDrag>", 'xt')
call assert_equal(3, &cmdheight)
call test_setmouse(&lines - 3, 1)
call feedkeys("\<LeftMouse>", 'xt')
call test_setmouse(&lines - 1, 1)
call feedkeys("\<LeftDrag>", 'xt')
call assert_equal(1, &cmdheight)
let &mouse = save_mouse
set laststatus&
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+1 -12
View File
@@ -108,7 +108,6 @@ internal_format(
char_u *line = ml_get_curline();
leader_len = get_leader_len(line, NULL, FALSE, TRUE);
#ifdef FEAT_CINDENT
if (leader_len == 0 && curbuf->b_p_cin)
{
int comment_start;
@@ -123,7 +122,6 @@ internal_format(
leader_len += comment_start;
}
}
#endif
}
else
leader_len = 0;
@@ -444,16 +442,12 @@ internal_format(
}
haveto_redraw = TRUE;
#ifdef FEAT_CINDENT
set_can_cindent(TRUE);
#endif
// moved the cursor, don't autoindent or cindent now
did_ai = FALSE;
#ifdef FEAT_SMARTINDENT
did_si = FALSE;
can_si = FALSE;
can_si_back = FALSE;
#endif
line_breakcheck();
}
@@ -1119,14 +1113,10 @@ format_lines(
// indent.
if (curwin->w_cursor.lnum == first_line)
indent = get_indent();
else
# ifdef FEAT_LISP
if (curbuf->b_p_lisp)
else if (curbuf->b_p_lisp)
indent = get_lisp_indent();
else
# endif
{
#ifdef FEAT_CINDENT
if (cindent_on())
{
indent =
@@ -1136,7 +1126,6 @@ format_lines(
get_c_indent();
}
else
#endif
indent = get_indent();
}
(void)set_indent(indent, SIN_CHANGED);
+101 -21
View File
@@ -4996,37 +4996,117 @@ ex_function(exarg_T *eap)
ga_clear_strings(&lines_to_free);
}
/*
* Find a function by name, including "<lambda>123".
* Check for "profile" and "debug" arguments and set"compile_type".
* Caller should initialize "compile_type" to CT_NONE.
* Return NULL if not found.
*/
ufunc_T *
find_func_by_name(char_u *name, compiletype_T *compile_type)
{
char_u *arg = name;
char_u *fname;
ufunc_T *ufunc;
int is_global = FALSE;
if (STRNCMP(arg, "profile", 7) == 0 && VIM_ISWHITE(arg[7]))
{
*compile_type = CT_PROFILE;
arg = skipwhite(arg + 7);
}
else if (STRNCMP(arg, "debug", 5) == 0 && VIM_ISWHITE(arg[5]))
{
*compile_type = CT_DEBUG;
arg = skipwhite(arg + 5);
}
if (STRNCMP(arg, "<lambda>", 8) == 0)
{
arg += 8;
(void)getdigits(&arg);
fname = vim_strnsave(name, arg - name);
}
else
fname = trans_function_name(&arg, &is_global, FALSE,
TFN_INT | TFN_QUIET | TFN_NO_AUTOLOAD, NULL, NULL, NULL);
if (fname == NULL)
{
semsg(_(e_invalid_argument_str), name);
return NULL;
}
if (!ends_excmd2(name, arg))
{
vim_free(fname);
emsg(ex_errmsg(e_trailing_characters_str, arg));
return NULL;
}
ufunc = find_func(fname, is_global);
if (ufunc == NULL)
{
char_u *p = untrans_function_name(fname);
if (p != NULL)
// Try again without making it script-local.
ufunc = find_func(p, FALSE);
}
vim_free(fname);
if (ufunc == NULL)
semsg(_(e_cannot_find_function_str), name);
return ufunc;
}
/*
* :defcompile - compile all :def functions in the current script that need to
* be compiled. Except dead functions. Doesn't do profiling.
* be compiled or the one specified by the argument.
* Skips dead functions. Doesn't do profiling.
*/
void
ex_defcompile(exarg_T *eap UNUSED)
ex_defcompile(exarg_T *eap)
{
long todo = (long)func_hashtab.ht_used;
int changed = func_hashtab.ht_changed;
hashitem_T *hi;
ufunc_T *ufunc;
for (hi = func_hashtab.ht_array; todo > 0 && !got_int; ++hi)
if (*eap->arg != NUL)
{
if (!HASHITEM_EMPTY(hi))
{
--todo;
ufunc = HI2UF(hi);
if (ufunc->uf_script_ctx.sc_sid == current_sctx.sc_sid
&& ufunc->uf_def_status == UF_TO_BE_COMPILED
&& (ufunc->uf_flags & FC_DEAD) == 0)
{
(void)compile_def_function(ufunc, FALSE, CT_NONE, NULL);
compiletype_T compile_type = CT_NONE;
if (func_hashtab.ht_changed != changed)
ufunc = find_func_by_name(eap->arg, &compile_type);
if (ufunc != NULL)
{
if (func_needs_compiling(ufunc, compile_type))
(void)compile_def_function(ufunc, FALSE, compile_type, NULL);
else
smsg(_("Function %s does not need compiling"), eap->arg);
}
}
else
{
long todo = (long)func_hashtab.ht_used;
int changed = func_hashtab.ht_changed;
hashitem_T *hi;
for (hi = func_hashtab.ht_array; todo > 0 && !got_int; ++hi)
{
if (!HASHITEM_EMPTY(hi))
{
--todo;
ufunc = HI2UF(hi);
if (ufunc->uf_script_ctx.sc_sid == current_sctx.sc_sid
&& ufunc->uf_def_status == UF_TO_BE_COMPILED
&& (ufunc->uf_flags & FC_DEAD) == 0)
{
// a function has been added or removed, need to start over
todo = (long)func_hashtab.ht_used;
changed = func_hashtab.ht_changed;
hi = func_hashtab.ht_array;
--hi;
(void)compile_def_function(ufunc, FALSE, CT_NONE, NULL);
if (func_hashtab.ht_changed != changed)
{
// a function has been added or removed, need to start
// over
todo = (long)func_hashtab.ht_used;
changed = func_hashtab.ht_changed;
hi = func_hashtab.ht_array;
--hi;
}
}
}
}
+28 -12
View File
@@ -152,11 +152,7 @@ static char *(features[]) =
#else
"-channel",
#endif
#ifdef FEAT_CINDENT
"+cindent",
#else
"-cindent",
#endif
#ifdef FEAT_CLIENTSERVER
"+clientserver",
#else
@@ -339,11 +335,7 @@ static char *(features[]) =
#else
"-linebreak",
#endif
#ifdef FEAT_LISP
"+lispindent",
#else
"-lispindent",
#endif
"+listcmds",
"+localmap",
#ifdef FEAT_LUA
@@ -556,11 +548,7 @@ static char *(features[]) =
#else
"-signs",
#endif
#ifdef FEAT_SMARTINDENT
"+smartindent",
#else
"-smartindent",
#endif
#ifdef FEAT_SODIUM
# ifdef DYNAMIC_SODIUM
"+sodium/dyn",
@@ -761,6 +749,34 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
4995,
/**/
4994,
/**/
4993,
/**/
4992,
/**/
4991,
/**/
4990,
/**/
4989,
/**/
4988,
/**/
4987,
/**/
4986,
/**/
4985,
/**/
4984,
/**/
4983,
/**/
4982,
/**/
4981,
/**/
+3 -43
View File
@@ -6277,55 +6277,15 @@ get_disassemble_argument(expand_T *xp, int idx)
ex_disassemble(exarg_T *eap)
{
char_u *arg = eap->arg;
char_u *fname;
ufunc_T *ufunc;
dfunc_T *dfunc;
isn_T *instr;
int instr_count;
int is_global = FALSE;
isn_T *instr = NULL; // init to shut up gcc warning
int instr_count = 0; // init to shut up gcc warning
compiletype_T compile_type = CT_NONE;
if (STRNCMP(arg, "profile", 7) == 0 && VIM_ISWHITE(arg[7]))
{
compile_type = CT_PROFILE;
arg = skipwhite(arg + 7);
}
else if (STRNCMP(arg, "debug", 5) == 0 && VIM_ISWHITE(arg[5]))
{
compile_type = CT_DEBUG;
arg = skipwhite(arg + 5);
}
if (STRNCMP(arg, "<lambda>", 8) == 0)
{
arg += 8;
(void)getdigits(&arg);
fname = vim_strnsave(eap->arg, arg - eap->arg);
}
else
fname = trans_function_name(&arg, &is_global, FALSE,
TFN_INT | TFN_QUIET | TFN_NO_AUTOLOAD, NULL, NULL, NULL);
if (fname == NULL)
{
semsg(_(e_invalid_argument_str), eap->arg);
return;
}
ufunc = find_func(fname, is_global);
ufunc = find_func_by_name(arg, &compile_type);
if (ufunc == NULL)
{
char_u *p = untrans_function_name(fname);
if (p != NULL)
// Try again without making it script-local.
ufunc = find_func(p, FALSE);
}
vim_free(fname);
if (ufunc == NULL)
{
semsg(_(e_cannot_find_function_str), eap->arg);
return;
}
if (func_needs_compiling(ufunc, compile_type)
&& compile_def_function(ufunc, FALSE, compile_type, NULL) == FAIL)
return;