Compare commits

...

10 Commits

Author SHA1 Message Date
Bram Moolenaar
97ce419201 patch 8.0.1361: some users don't want to diff with hidden buffers
Problem:    Some users don't want to diff with hidden buffers.
Solution:   Add the "hiddenoff" item to 'diffopt'. (Alisue, closes #2394)
2017-12-01 20:35:58 +01:00
Bram Moolenaar
76bb7196f5 patch 8.0.1360: the Terminal highlighting doesn't work in a terminal
Problem:    The Terminal highlighting doesn't work in a terminal. (Ozaki
            Kiichi)
Solution:   Use the Terminal highlighting when the cterm index is zero.
2017-11-30 22:07:07 +01:00
Bram Moolenaar
2f0584910c Update runtime files 2017-11-30 20:27:52 +01:00
Bram Moolenaar
46359e198f patch 8.0.1359: libvterm ANSI colors can not always be recognized
Problem:    Libvterm ANSI colors can not always be recognized from the RGB
            values. The default color is wrong when t_RB is empty.
Solution:   Add the ANSI color index to VTermColor.
2017-11-29 22:33:38 +01:00
Bram Moolenaar
8b9e20afb0 patch 8.0.1358: undercurl is not used in the terminal
Problem:    Undercurl is not used in the terminal. (Kovid Goyal)
Solution:   Only fall back to underline when undercurl highlighting is not
            defined. (closes #1306)
2017-11-28 21:25:21 +01:00
Bram Moolenaar
1a2ab991a6 patch 8.0.1357: startup test fails on OpenBSD
Problem:    Startup test fails on OpenBSD. (Edd Barrett)
Solution:   Check for "BSD" instead of "FreeBSD" being defined. (James McCoy,
            closes #2376, closes #2378)
2017-11-28 21:06:18 +01:00
Bram Moolenaar
c5aa55db7e patch 8.0.1356: using simalt in a GUIEnter autocommand inserts characters
Problem:    Using simalt in a GUIEnter autocommand inserts strange characters.
            (Chih-Long Chang)
Solution:   Ignore K_NOP in Insert mode. (closes #2379)
2017-11-28 20:47:40 +01:00
Bram Moolenaar
a45ff6caba patch 8.0.1355: cursor keys don't work in MS-Windows console
Problem:    Cursor keys don't work in MS-Windows console.
Solution:   Revert the previous patch.  Also delete dead code.
2017-11-28 20:06:10 +01:00
Bram Moolenaar
3660a10c73 patch 8.0.1354: Shift-Insert doesn't always work in MS-Windows console
Problem:    Shift-Insert doesn't always work in MS-Windows console.
Solution:   Handle K_NUL differently. (Yasuhiro Matsumoto, closes #2381)
2017-11-28 18:07:59 +01:00
Bram Moolenaar
1ed2276fd5 patch 8.0.1353: QuickFixCmdPost is not used consistently
Problem:    QuickFixCmdPost is not used consistently.
Solution:   Invoke QuickFixCmdPost consistently after QuickFixCmdPre.
            (Yegappan Lakshmanan, closes #2377)
2017-11-28 18:03:44 +01:00
29 changed files with 1367 additions and 638 deletions

View File

@@ -375,6 +375,10 @@ tags.ref tags.html: tags
perlhtml: tags $(DOCS) perlhtml: tags $(DOCS)
./vim2html.pl tags $(DOCS) ./vim2html.pl tags $(DOCS)
# Check URLs in the help with "curl".
test_urls:
vim -S test_urls.vim
clean: clean:
-rm doctags *.html tags.ref -rm doctags *.html tags.ref

View File

@@ -1,4 +1,4 @@
*eval.txt* For Vim version 8.0. Last change: 2017 Nov 19 *eval.txt* For Vim version 8.0. Last change: 2017 Nov 24
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -4662,11 +4662,11 @@ getqflist([{what}]) *getqflist()*
following string items are supported in {what}: following string items are supported in {what}:
context get the context stored with |setqflist()| context get the context stored with |setqflist()|
efm errorformat to use when parsing "lines". If efm errorformat to use when parsing "lines". If
not present, then the 'erroformat' option not present, then the 'errorformat' option
value is used. value is used.
id get information for the quickfix list with id get information for the quickfix list with
|quickfix-ID|; zero means the id for the |quickfix-ID|; zero means the id for the
current list or the list specifed by "nr" current list or the list specified by "nr"
idx index of the current entry in the list idx index of the current entry in the list
items quickfix list entries items quickfix list entries
lines use 'errorformat' to extract items from a list lines use 'errorformat' to extract items from a list
@@ -7695,8 +7695,9 @@ submatch({nr} [, {list}]) *submatch()* *E935*
When substitute() is used recursively only the submatches in When substitute() is used recursively only the submatches in
the current (deepest) call can be obtained. the current (deepest) call can be obtained.
Example: > Examples: >
:s/\d\+/\=submatch(0) + 1/ :s/\d\+/\=submatch(0) + 1/
:echo substitute(text, '\d\+', '\=submatch(0) + 1', '')
< This finds the first number in the line and adds one to it. < This finds the first number in the line and adds one to it.
A line break is included as a newline character. A line break is included as a newline character.

View File

@@ -1,4 +1,4 @@
*if_cscop.txt* For Vim version 8.0. Last change: 2017 Jun 14 *if_cscop.txt* For Vim version 8.0. Last change: 2017 Nov 23
VIM REFERENCE MANUAL by Andy Kahn VIM REFERENCE MANUAL by Andy Kahn
@@ -468,36 +468,18 @@ license or OS distribution), then you can download it for free from:
http://cscope.sourceforge.net/ http://cscope.sourceforge.net/
This is released by SCO under the BSD license. This is released by SCO under the BSD license.
If you want a newer version of cscope, you will probably have to buy it.
According to the (old) nvi documentation:
You can buy version 13.3 source with an unrestricted license
for $400 from AT&T Software Solutions by calling +1-800-462-8146.
Also you can download cscope 13.x and mlcscope 14.x (multi-lingual cscope
which supports C, C++, Java, lex, yacc, breakpoint listing, Ingres, and SDL)
from World-Wide Exptools Open Source packages page:
http://www.bell-labs.com/project/wwexptools/packages.html
In Solaris 2.x, if you have the C compiler license, you will also have In Solaris 2.x, if you have the C compiler license, you will also have
cscope. Both are usually located under /opt/SUNWspro/bin cscope. Both are usually located under /opt/SUNWspro/bin
SGI developers can also get it. Search for Cscope on this page:
http://freeware.sgi.com/index-by-alpha.html
https://toolbox.sgi.com/toolbox/utilities/cscope/
The second one is for those who have a password for the SGI toolbox.
There is source to an older version of a cscope clone (called "cs") available There is source to an older version of a cscope clone (called "cs") available
on the net. Due to various reasons, this is not supported with Vim. on the net. Due to various reasons, this is not supported with Vim.
The cscope interface/support for Vim was originally written by The cscope interface/support for Vim was originally written by
Andy Kahn <ackahn@netapp.com>. The original structure (as well as a tiny Andy Kahn <ackahn@netapp.com>. The original structure (as well as a tiny
bit of code) was adapted from the cscope interface in nvi. Please report bit of code) was adapted from the cscope interface in nvi.
any problems, suggestions, patches, et al., you have for the usage of
cscope within Vim to him.
*cscope-win32* *cscope-win32*
For a cscope version for Win32 see: For a cscope version for Win32 see (seems abandonded):
http://code.google.com/p/cscope-win32/ https://code.google.com/archive/p/cscope-win32/
Win32 support was added by Sergey Khorev <sergey.khorev@gmail.com>. Contact Win32 support was added by Sergey Khorev <sergey.khorev@gmail.com>. Contact
him if you have Win32-specific issues. him if you have Win32-specific issues.

View File

@@ -1,4 +1,4 @@
*if_perl.txt* For Vim version 8.0. Last change: 2015 Oct 16 *if_perl.txt* For Vim version 8.0. Last change: 2017 Nov 24
VIM REFERENCE MANUAL by Sven Verdoolaege VIM REFERENCE MANUAL by Sven Verdoolaege
@@ -112,7 +112,7 @@ possible.
Here is an overview of the functions that are available to Perl: > Here is an overview of the functions that are available to Perl: >
:perl VIM::Msg("Text") # displays a message :perl VIM::Msg("Text") # displays a message
:perl VIM::Msg("Error", "ErrorMsg") # displays an error message :perl VIM::Msg("Wrong!", "ErrorMsg") # displays an error message
:perl VIM::Msg("remark", "Comment") # displays a highlighted message :perl VIM::Msg("remark", "Comment") # displays a highlighted message
:perl VIM::SetOption("ai") # sets a vim option :perl VIM::SetOption("ai") # sets a vim option
:perl $nbuf = VIM::Buffers() # returns the number of buffers :perl $nbuf = VIM::Buffers() # returns the number of buffers

View File

@@ -1,4 +1,4 @@
*insert.txt* For Vim version 8.0. Last change: 2017 May 30 *insert.txt* For Vim version 8.0. Last change: 2017 Nov 23
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1296,7 +1296,8 @@ it here: http://ctags.sourceforge.net/ Version 5.6 or later is recommended.
For version 5.5.4 you should add a patch that adds the "typename:" field: For version 5.5.4 you should add a patch that adds the "typename:" field:
ftp://ftp.vim.org/pub/vim/unstable/patches/ctags-5.5.4.patch ftp://ftp.vim.org/pub/vim/unstable/patches/ctags-5.5.4.patch
A compiled .exe for MS-Windows can be found at: A compiled .exe for MS-Windows can be found at:
http://georgevreilly.com/vim/ctags.html http://ctags.sourceforge.net/
https://github.com/universal-ctags/ctags-win32
If you want to complete system functions you can do something like this. Use If you want to complete system functions you can do something like this. Use
ctags to generate a tags file for all the system header files: > ctags to generate a tags file for all the system header files: >

View File

@@ -1,4 +1,4 @@
*mbyte.txt* For Vim version 8.0. Last change: 2016 Jul 21 *mbyte.txt* For Vim version 8.0. Last change: 2017 Nov 30
VIM REFERENCE MANUAL by Bram Moolenaar et al. VIM REFERENCE MANUAL by Bram Moolenaar et al.
@@ -1257,8 +1257,8 @@ Combining forms:
============================================================================== ==============================================================================
10. Input with imactivatefunc() *mbyte-func* 10. Input with imactivatefunc() *mbyte-func*
Vim has |imactivatefunc()| and |imstatusfunc()|. This is useful to Vim has the 'imactivatefunc' and 'imstatusfunc' options. These are useful to
activate/deativate input method from Vim in any way, also with an external activate/deativate the input method from Vim in any way, also with an external
command. For example, fcitx provide fcitx-remote command: > command. For example, fcitx provide fcitx-remote command: >
set iminsert=2 set iminsert=2

View File

@@ -1,4 +1,4 @@
*options.txt* For Vim version 8.0. Last change: 2017 Nov 18 *options.txt* For Vim version 8.0. Last change: 2017 Nov 26
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2634,6 +2634,9 @@ A jump table for the options with a short description can be found at |Q_op|.
vertical Start diff mode with vertical splits (unless vertical Start diff mode with vertical splits (unless
explicitly specified otherwise). explicitly specified otherwise).
hiddenoff Do not use diff mode for a buffer when it
becomes hidden.
foldcolumn:{n} Set the 'foldcolumn' option to {n} when foldcolumn:{n} Set the 'foldcolumn' option to {n} when
starting diff mode. Without this 2 is used. starting diff mode. Without this 2 is used.
@@ -4464,8 +4467,8 @@ A jump table for the options with a short description can be found at |Q_op|.
match may not be found. This is to avoid that Vim hangs while you match may not be found. This is to avoid that Vim hangs while you
are typing the pattern. are typing the pattern.
The highlighting can be set with the 'i' flag in 'highlight'. The highlighting can be set with the 'i' flag in 'highlight'.
When 'hlsearch' is on, all matched strings are highlighted too while typing When 'hlsearch' is on, all matched strings are highlighted too while
a search command. See also: 'hlsearch'. typing a search command. See also: 'hlsearch'.
If you don't want turn 'hlsearch' on, but want to highlight all matches If you don't want turn 'hlsearch' on, but want to highlight all matches
while searching, you can turn on and off 'hlsearch' with autocmd. while searching, you can turn on and off 'hlsearch' with autocmd.
Example: > Example: >
@@ -8255,7 +8258,7 @@ A jump table for the options with a short description can be found at |Q_op|.
number, more intelligent detection process runs. number, more intelligent detection process runs.
The "xterm2" value will be set if the xterm version is reported to be The "xterm2" value will be set if the xterm version is reported to be
from 95 to 276. The "sgr" value will be set if the xterm version is from 95 to 276. The "sgr" value will be set if the xterm version is
277 or highter and when Vim detects Mac Terminal.app or Iterm2. 277 or higher and when Vim detects Mac Terminal.app or iTerm2.
If you do not want 'ttymouse' to be set to "xterm2" or "sgr" If you do not want 'ttymouse' to be set to "xterm2" or "sgr"
automatically, set t_RV to an empty string: > automatically, set t_RV to an empty string: >
:set t_RV= :set t_RV=

View File

@@ -7346,6 +7346,7 @@ mbyte-encoding mbyte.txt /*mbyte-encoding*
mbyte-first mbyte.txt /*mbyte-first* mbyte-first mbyte.txt /*mbyte-first*
mbyte-fonts-MSwin mbyte.txt /*mbyte-fonts-MSwin* mbyte-fonts-MSwin mbyte.txt /*mbyte-fonts-MSwin*
mbyte-fonts-X11 mbyte.txt /*mbyte-fonts-X11* mbyte-fonts-X11 mbyte.txt /*mbyte-fonts-X11*
mbyte-func mbyte.txt /*mbyte-func*
mbyte-keymap mbyte.txt /*mbyte-keymap* mbyte-keymap mbyte.txt /*mbyte-keymap*
mbyte-locale mbyte.txt /*mbyte-locale* mbyte-locale mbyte.txt /*mbyte-locale*
mbyte-options mbyte.txt /*mbyte-options* mbyte-options mbyte.txt /*mbyte-options*

View File

@@ -1,4 +1,4 @@
*todo.txt* For Vim version 8.0. Last change: 2017 Nov 21 *todo.txt* For Vim version 8.0. Last change: 2017 Nov 29
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -35,6 +35,13 @@ entered there will not be repeated below, unless there is extra information.
*known-bugs* *known-bugs*
-------------------- Known bugs and current work ----------------------- -------------------- Known bugs and current work -----------------------
Motif testgui:
From test_options.vim:
Found errors in Test_set_values():
Caught exception in Test_set_values(): Vim(set):E596: Invalid font(s): guifont=fixedsys @ /home/mool/vim/vim80/src/testdir/opt_test.vim, line 1153
WinBar: balloon shows up for next line
No maintainer for Vietnamese translations. No maintainer for Vietnamese translations.
No maintainer for Simplified Chinese translations. No maintainer for Simplified Chinese translations.
@@ -150,8 +157,17 @@ Compiler warnings (geeknik, 2017 Oct 26):
- signed integer overflow in nfa_regatom() (#2251) - signed integer overflow in nfa_regatom() (#2251)
- undefined left shift in get_string_tv() (#2250) - undefined left shift in get_string_tv() (#2250)
Patch to use imactivatefunc() also without +xim feature. (Yasuhiro Matsumoto, patch for: fix SHIFT-Insert on Windows command prompt (Yasuhiro Matsumoto,
2017 Nov 19, #2349) #2381)
Patch for profile log truncating halfway a character. (ichizok, 2017 Nov 28,
#2385)
WinBar: Maximizing window causes window size to be wrong. (Lifepillar, 2017
Nov 29, #2356)
CTRL-A does not work with empty line. (Alex, #2387)
Patch by Hirohito Higashi, 2017 Nov 29.
'hlsearch' shows empty matches, which means highlighting everything. 'hlsearch' shows empty matches, which means highlighting everything.
Don't do that. For "foo\|" or "\v" Don't do that. For "foo\|" or "\v"
@@ -171,12 +187,6 @@ With foldmethod=syntax and nofoldenable comment highlighting isn't removed.
Using 'wildignore' also applies to literally entered file name. Also with Using 'wildignore' also applies to literally entered file name. Also with
:drop (remote commands). :drop (remote commands).
Race condition between stat() and open() in write_viminfo(). Use open() in the
loop and try another name instead of using a temp file. (Simon Ruderich)
The first one, when viminfo is new, should just fail if it creating with
O_EXCL fails.
Also use umask instead of mch_fopen() after vim_tempname().
"gvim --remote" from a directory with non-word characters changes the current "gvim --remote" from a directory with non-word characters changes the current
directory (Paulo Marcel Coelho Arabic, 2017 Oct 30, #2266) directory (Paulo Marcel Coelho Arabic, 2017 Oct 30, #2266)
Also see #1689. Also see #1689.
@@ -184,6 +194,9 @@ Also see #1689.
ml_get error when using a Python. (Yggdroot, 2017 Jun 1, #1737) ml_get error when using a Python. (Yggdroot, 2017 Jun 1, #1737)
Lemonboy can reproduce (2017 Jun 5) Lemonboy can reproduce (2017 Jun 5)
Patch to fix E806. (Dominique, 2017 Nov 22, #2368)
Kazunobu Kuriyama: caused by XtSetLanguageProc().
Invalid range error when using BufWinLeave for closing terminal. Invalid range error when using BufWinLeave for closing terminal.
(Gabriel Barta, 2017 Nov 15, #2339) (Gabriel Barta, 2017 Nov 15, #2339)
@@ -208,7 +221,7 @@ Patch to fix cmdline abbreviation after '<,'>. (Christian Brabandt, 2017 Nov
Patch to add TextDeletePost and TextYankPost events. (Philippe Vaucher, 2011 Patch to add TextDeletePost and TextYankPost events. (Philippe Vaucher, 2011
May 24) Update May 26. May 24) Update May 26.
Now in patch by Lemonboy, #2333 (who is Lemonboy?) Now in patch by Lemonboy, #2333
Default install on MS-Windows should source defaults.vim. Default install on MS-Windows should source defaults.vim.
Ask whether to use Windows or Vim key behavior? Ask whether to use Windows or Vim key behavior?

View File

@@ -1,4 +1,4 @@
*version8.txt* For Vim version 8.0. Last change: 2017 Apr 23 *version8.txt* For Vim version 8.0. Last change: 2017 Nov 24
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -15582,7 +15582,7 @@ Files: src/json.c, src/testdir/test_json.vim
Patch 8.0.0181 Patch 8.0.0181
Problem: When 'cursorbind' and 'cursorcolumn' are both on, the column Problem: When 'cursorbind' and 'cursorcolumn' are both on, the column
highlignt in non-current windows is wrong. highlight in non-current windows is wrong.
Solution: Add validate_cursor(). (Masanori Misono, closes #1372) Solution: Add validate_cursor(). (Masanori Misono, closes #1372)
Files: src/move.c Files: src/move.c

View File

@@ -1,7 +1,7 @@
" Vim support file to detect file types " Vim support file to detect file types
" "
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2017 Nov 21 " Last Change: 2017 Nov 23
" Listen very carefully, I will say this only once " Listen very carefully, I will say this only once
if exists("did_load_filetypes") if exists("did_load_filetypes")
@@ -1878,8 +1878,8 @@ au BufNewFile,BufRead *.yy,*.yxx,*.y++ setf yacc
" Yacc or racc " Yacc or racc
au BufNewFile,BufRead *.y call dist#ft#FTy() au BufNewFile,BufRead *.y call dist#ft#FTy()
" Yaml " Yaml or Raml
au BufNewFile,BufRead *.yaml,*.yml setf yaml au BufNewFile,BufRead *.yaml,*.yml,*.raml setf yaml
" yum conf (close enough to dosini) " yum conf (close enough to dosini)
au BufNewFile,BufRead */etc/yum.conf setf dosini au BufNewFile,BufRead */etc/yum.conf setf dosini

View File

@@ -2,7 +2,7 @@
" Language: Zsh shell script " Language: Zsh shell script
" Maintainer: Christian Brabandt <cb@256bit.org> " Maintainer: Christian Brabandt <cb@256bit.org>
" Previous Maintainer: Nikolai Weibull <now@bitwi.se> " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2015-05-29 " Latest Revision: 2017-11-22
" License: Vim (see :h license) " License: Vim (see :h license)
" Repository: https://github.com/chrisbra/vim-zsh " Repository: https://github.com/chrisbra/vim-zsh
@@ -18,9 +18,7 @@ let b:undo_ftplugin = "setl com< cms< fo<"
setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
let b:match_words = let b:match_words = ',\<if\>:\<elif\>:\<else\>:\<fi\>'
\ &matchpairs
\ . ',\<if\>:\<elif\>:\<else\>:\<fi\>'
\ . ',\<case\>:^\s*([^)]*):\<esac\>' \ . ',\<case\>:^\s*([^)]*):\<esac\>'
\ . ',\<\%(select\|while\|until\|repeat\|for\%(each\)\=\)\>:\<done\>' \ . ',\<\%(select\|while\|until\|repeat\|for\%(each\)\=\)\>:\<done\>'
let b:match_skip = 's:comment\|string\|heredoc\|subst' let b:match_skip = 's:comment\|string\|heredoc\|subst'

File diff suppressed because it is too large Load Diff

View File

@@ -2,7 +2,7 @@
" Language: Zsh shell script " Language: Zsh shell script
" Maintainer: Christian Brabandt <cb@256bit.org> " Maintainer: Christian Brabandt <cb@256bit.org>
" Previous Maintainer: Nikolai Weibull <now@bitwi.se> " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2017-07-11 " Latest Revision: 2017-11-22
" License: Vim (see :h license) " License: Vim (see :h license)
" Repository: https://github.com/chrisbra/vim-zsh " Repository: https://github.com/chrisbra/vim-zsh
@@ -324,9 +324,9 @@ syn match zshOption /
\ \%(\%(\<no_\?\)\?vi\>\)\| \ \%(\%(\<no_\?\)\?vi\>\)\|
\ \%(\%(\<no_\?\)\?warncreateglobal\>\)\|\%(\%(no_\?\)\?warn_create_global\>\)\| \ \%(\%(\<no_\?\)\?warncreateglobal\>\)\|\%(\%(no_\?\)\?warn_create_global\>\)\|
\ \%(\%(\<no_\?\)\?xtrace\>\)\| \ \%(\%(\<no_\?\)\?xtrace\>\)\|
\ \%(\%(\<no_\?\)\?zle\>\)/ nextgroup=zshOption skipwhite contained \ \%(\%(\<no_\?\)\?zle\>\)/ nextgroup=zshOption,zshComment skipwhite contained
syn keyword zshTypes float integer local typeset declare private syn keyword zshTypes float integer local typeset declare private readonly
" XXX: this may be too much " XXX: this may be too much
" syn match zshSwitches '\s\zs--\=[a-zA-Z0-9-]\+' " syn match zshSwitches '\s\zs--\=[a-zA-Z0-9-]\+'

View File

@@ -593,6 +593,11 @@ aucmd_abort:
if (buf->b_nwindows > 0) if (buf->b_nwindows > 0)
--buf->b_nwindows; --buf->b_nwindows;
#ifdef FEAT_DIFF
if (diffopt_hiddenoff() && !unload_buf && buf->b_nwindows == 0)
diff_buf_delete(buf); /* Clear 'diff' for hidden buffer. */
#endif
/* Return when a window is displaying the buffer or when it's not /* Return when a window is displaying the buffer or when it's not
* unloaded. */ * unloaded. */
if (buf->b_nwindows > 0 || !unload_buf) if (buf->b_nwindows > 0 || !unload_buf)

View File

@@ -23,6 +23,7 @@ static int diff_busy = FALSE; /* ex_diffgetput() is busy */
#define DIFF_IWHITE 4 /* ignore change in white space */ #define DIFF_IWHITE 4 /* ignore change in white space */
#define DIFF_HORIZONTAL 8 /* horizontal splits */ #define DIFF_HORIZONTAL 8 /* horizontal splits */
#define DIFF_VERTICAL 16 /* vertical splits */ #define DIFF_VERTICAL 16 /* vertical splits */
#define DIFF_HIDDEN_OFF 32 /* diffoff when hidden */
static int diff_flags = DIFF_FILLER; static int diff_flags = DIFF_FILLER;
#define LBUFLEN 50 /* length of line in diff file */ #define LBUFLEN 50 /* length of line in diff file */
@@ -1924,6 +1925,11 @@ diffopt_changed(void)
p += 11; p += 11;
diff_foldcolumn_new = getdigits(&p); diff_foldcolumn_new = getdigits(&p);
} }
else if (STRNCMP(p, "hiddenoff", 9) == 0)
{
p += 9;
diff_flags_new |= DIFF_HIDDEN_OFF;
}
if (*p != ',' && *p != NUL) if (*p != ',' && *p != NUL)
return FAIL; return FAIL;
if (*p == ',') if (*p == ',')
@@ -1961,6 +1967,15 @@ diffopt_horizontal(void)
return (diff_flags & DIFF_HORIZONTAL) != 0; return (diff_flags & DIFF_HORIZONTAL) != 0;
} }
/*
* Return TRUE if 'diffopt' contains "hiddenoff".
*/
int
diffopt_hiddenoff(void)
{
return (diff_flags & DIFF_HIDDEN_OFF) != 0;
}
/* /*
* Find the difference within a changed line. * Find the difference within a changed line.
* Returns TRUE if the line was added, no other buffer has it. * Returns TRUE if the line was added, no other buffer has it.

View File

@@ -781,7 +781,7 @@ edit(
#endif #endif
/* /*
* Get a character for Insert mode. Ignore K_IGNORE. * Get a character for Insert mode. Ignore K_IGNORE and K_NOP.
*/ */
if (c != K_CURSORHOLD) if (c != K_CURSORHOLD)
lastc = c; /* remember the previous char for CTRL-D */ lastc = c; /* remember the previous char for CTRL-D */
@@ -798,7 +798,7 @@ edit(
do do
{ {
c = safe_vgetc(); c = safe_vgetc();
} while (c == K_IGNORE); } while (c == K_IGNORE || c == K_NOP);
#ifdef FEAT_AUTOCMD #ifdef FEAT_AUTOCMD
/* Don't want K_CURSORHOLD for the second key, e.g., after CTRL-V. */ /* Don't want K_CURSORHOLD for the second key, e.g., after CTRL-V. */

View File

@@ -417,12 +417,12 @@ getcmdline(
cursorcmd(); /* set the cursor on the right spot */ cursorcmd(); /* set the cursor on the right spot */
/* Get a character. Ignore K_IGNORE, it should not do anything, such /* Get a character. Ignore K_IGNORE and K_NOP, they should not do
* as stop completion. */ * anything, such as stop completion. */
do do
{ {
c = safe_vgetc(); c = safe_vgetc();
} while (c == K_IGNORE); } while (c == K_IGNORE || c == K_NOP);
if (KeyTyped) if (KeyTyped)
{ {

View File

@@ -79,8 +79,16 @@ INLINE void vterm_rect_move(VTermRect *rect, int row_delta, int col_delta)
} }
#endif #endif
/* The ansi_index is used for the lower 16 colors, which can be set to any
* color. */
#define VTERM_ANSI_INDEX_DEFAULT 0 /* color cleared */
#define VTERM_ANSI_INDEX_MIN 1
#define VTERM_ANSI_INDEX_MAX 16
#define VTERM_ANSI_INDEX_NONE 255 /* non-ANSI color, use red/green/blue */
typedef struct { typedef struct {
uint8_t red, green, blue; uint8_t red, green, blue;
uint8_t ansi_index;
} VTermColor; } VTermColor;
typedef enum { typedef enum {

View File

@@ -3,25 +3,25 @@
#include <stdio.h> #include <stdio.h>
static const VTermColor ansi_colors[] = { static const VTermColor ansi_colors[] = {
/* R G B */ /* R G B index */
{ 0, 0, 0 }, /* black */ { 0, 0, 0, 1 }, /* black */
{ 224, 0, 0 }, /* red */ { 224, 0, 0, 2 }, /* red */
{ 0, 224, 0 }, /* green */ { 0, 224, 0, 3 }, /* green */
{ 224, 224, 0 }, /* yellow */ { 224, 224, 0, 4 }, /* yellow */
{ 0, 0, 224 }, /* blue */ { 0, 0, 224, 5 }, /* blue */
{ 224, 0, 224 }, /* magenta */ { 224, 0, 224, 6 }, /* magenta */
{ 0, 224, 224 }, /* cyan */ { 0, 224, 224, 7 }, /* cyan */
{ 224, 224, 224 }, /* white == light grey */ { 224, 224, 224, 8 }, /* white == light grey */
/* high intensity */ /* high intensity */
{ 128, 128, 128 }, /* black */ { 128, 128, 128, 9 }, /* black */
{ 255, 64, 64 }, /* red */ { 255, 64, 64, 10 }, /* red */
{ 64, 255, 64 }, /* green */ { 64, 255, 64, 11 }, /* green */
{ 255, 255, 64 }, /* yellow */ { 255, 255, 64, 12 }, /* yellow */
{ 64, 64, 255 }, /* blue */ { 64, 64, 255, 13 }, /* blue */
{ 255, 64, 255 }, /* magenta */ { 255, 64, 255, 14 }, /* magenta */
{ 64, 255, 255 }, /* cyan */ { 64, 255, 255, 15 }, /* cyan */
{ 255, 255, 255 }, /* white for real */ { 255, 255, 255, 16 }, /* white for real */
}; };
static int ramp6[] = { static int ramp6[] = {
@@ -57,6 +57,7 @@ static int lookup_colour_palette(const VTermState *state, long index, VTermColor
col->blue = ramp6[index % 6]; col->blue = ramp6[index % 6];
col->green = ramp6[index/6 % 6]; col->green = ramp6[index/6 % 6];
col->red = ramp6[index/6/6 % 6]; col->red = ramp6[index/6/6 % 6];
col->ansi_index = VTERM_ANSI_INDEX_NONE;
return TRUE; return TRUE;
} }
@@ -67,6 +68,7 @@ static int lookup_colour_palette(const VTermState *state, long index, VTermColor
col->blue = ramp24[index]; col->blue = ramp24[index];
col->green = ramp24[index]; col->green = ramp24[index];
col->red = ramp24[index]; col->red = ramp24[index];
col->ansi_index = VTERM_ANSI_INDEX_NONE;
return TRUE; return TRUE;
} }
@@ -84,6 +86,7 @@ static int lookup_colour(const VTermState *state, int palette, const long args[]
col->red = (uint8_t)CSI_ARG(args[0]); col->red = (uint8_t)CSI_ARG(args[0]);
col->green = (uint8_t)CSI_ARG(args[1]); col->green = (uint8_t)CSI_ARG(args[1]);
col->blue = (uint8_t)CSI_ARG(args[2]); col->blue = (uint8_t)CSI_ARG(args[2]);
col->ansi_index = VTERM_ANSI_INDEX_NONE;
return 3; return 3;
@@ -152,7 +155,9 @@ INTERNAL void vterm_state_newpen(VTermState *state)
/* 90% grey so that pure white is brighter */ /* 90% grey so that pure white is brighter */
state->default_fg.red = state->default_fg.green = state->default_fg.blue = 240; state->default_fg.red = state->default_fg.green = state->default_fg.blue = 240;
state->default_fg.ansi_index = VTERM_ANSI_INDEX_DEFAULT;
state->default_bg.red = state->default_bg.green = state->default_bg.blue = 0; state->default_bg.red = state->default_bg.green = state->default_bg.blue = 0;
state->default_bg.ansi_index = VTERM_ANSI_INDEX_DEFAULT;
for(col = 0; col < 16; col++) for(col = 0; col < 16; col++)
state->colors[col] = ansi_colors[col]; state->colors[col] = ansi_colors[col];
@@ -208,13 +213,18 @@ void vterm_state_get_palette_color(const VTermState *state, int index, VTermColo
void vterm_state_set_default_colors(VTermState *state, const VTermColor *default_fg, const VTermColor *default_bg) void vterm_state_set_default_colors(VTermState *state, const VTermColor *default_fg, const VTermColor *default_bg)
{ {
state->default_fg = *default_fg; state->default_fg = *default_fg;
state->default_fg.ansi_index = VTERM_ANSI_INDEX_DEFAULT;
state->default_bg = *default_bg; state->default_bg = *default_bg;
state->default_bg.ansi_index = VTERM_ANSI_INDEX_DEFAULT;
} }
void vterm_state_set_palette_color(VTermState *state, int index, const VTermColor *col) void vterm_state_set_palette_color(VTermState *state, int index, const VTermColor *col)
{ {
if(index >= 0 && index < 16) if(index >= 0 && index < 16)
{
state->colors[index] = *col; state->colors[index] = *col;
state->colors[index].ansi_index = index + VTERM_ANSI_INDEX_MIN;
}
} }
void vterm_state_set_bold_highbright(VTermState *state, int bold_is_highbright) void vterm_state_set_bold_highbright(VTermState *state, int bold_is_highbright)

View File

@@ -1789,7 +1789,6 @@ mch_inchar(
#endif #endif
{ {
int n = 1; int n = 1;
int conv = FALSE;
#ifdef FEAT_MBYTE #ifdef FEAT_MBYTE
if (ch2 == NUL) if (ch2 == NUL)
@@ -1822,28 +1821,6 @@ mch_inchar(
n += 2; n += 2;
} }
if (conv)
{
char_u *p = typeahead + typeaheadlen;
if (*p != K_NUL)
{
char_u *e = typeahead + TYPEAHEADLEN;
while (*p && p < e)
{
if (*p == K_NUL)
{
++p;
mch_memmove(p + 1, p, ((size_t)(e - p)) - 1);
*p = 3;
++n;
}
++p;
}
}
}
/* Use the ALT key to set the 8th bit of the character /* Use the ALT key to set the 8th bit of the character
* when it's one byte, the 8th bit isn't set yet and not * when it's one byte, the 8th bit isn't set yet and not
* using a double-byte encoding (would become a lead * using a double-byte encoding (would become a lead

View File

@@ -16,6 +16,7 @@ int diff_check_fill(win_T *wp, linenr_T lnum);
void diff_set_topline(win_T *fromwin, win_T *towin); void diff_set_topline(win_T *fromwin, win_T *towin);
int diffopt_changed(void); int diffopt_changed(void);
int diffopt_horizontal(void); int diffopt_horizontal(void);
int diffopt_hiddenoff(void);
int diff_find_change(win_T *wp, linenr_T lnum, int *startp, int *endp); int diff_find_change(win_T *wp, linenr_T lnum, int *startp, int *endp);
int diff_infold(win_T *wp, linenr_T lnum); int diff_infold(win_T *wp, linenr_T lnum);
void nv_diffgetput(int put, long count); void nv_diffgetput(int put, long count);

View File

@@ -4055,6 +4055,7 @@ ex_cfile(exarg_T *eap)
#ifdef FEAT_AUTOCMD #ifdef FEAT_AUTOCMD
char_u *au_name = NULL; char_u *au_name = NULL;
#endif #endif
int res;
if (eap->cmdidx == CMD_lfile || eap->cmdidx == CMD_lgetfile if (eap->cmdidx == CMD_lfile || eap->cmdidx == CMD_lgetfile
|| eap->cmdidx == CMD_laddfile) || eap->cmdidx == CMD_laddfile)
@@ -4102,28 +4103,18 @@ ex_cfile(exarg_T *eap)
* :caddfile adds to an existing quickfix list. If there is no * :caddfile adds to an existing quickfix list. If there is no
* quickfix list then a new list is created. * quickfix list then a new list is created.
*/ */
if (qf_init(wp, p_ef, p_efm, (eap->cmdidx != CMD_caddfile res = qf_init(wp, p_ef, p_efm, (eap->cmdidx != CMD_caddfile
&& eap->cmdidx != CMD_laddfile), && eap->cmdidx != CMD_laddfile), *eap->cmdlinep, enc);
*eap->cmdlinep, enc) > 0
&& (eap->cmdidx == CMD_cfile
|| eap->cmdidx == CMD_lfile))
{
#ifdef FEAT_AUTOCMD #ifdef FEAT_AUTOCMD
if (au_name != NULL) if (au_name != NULL)
apply_autocmds(EVENT_QUICKFIXCMDPOST, au_name, NULL, FALSE, curbuf); apply_autocmds(EVENT_QUICKFIXCMDPOST, au_name, NULL, FALSE, curbuf);
#endif #endif
if (res > 0 && (eap->cmdidx == CMD_cfile || eap->cmdidx == CMD_lfile))
{
if (wp != NULL) if (wp != NULL)
qi = GET_LOC_LIST(wp); qi = GET_LOC_LIST(wp);
qf_jump(qi, 0, 0, eap->forceit); /* display first error */ qf_jump(qi, 0, 0, eap->forceit); /* display first error */
} }
else
{
#ifdef FEAT_AUTOCMD
if (au_name != NULL)
apply_autocmds(EVENT_QUICKFIXCMDPOST, au_name, NULL, FALSE, curbuf);
#endif
}
} }
/* /*
@@ -5450,6 +5441,7 @@ ex_cbuffer(exarg_T *eap)
#ifdef FEAT_AUTOCMD #ifdef FEAT_AUTOCMD
char_u *au_name = NULL; char_u *au_name = NULL;
#endif #endif
int res;
if (eap->cmdidx == CMD_lbuffer || eap->cmdidx == CMD_lgetbuffer if (eap->cmdidx == CMD_lbuffer || eap->cmdidx == CMD_lgetbuffer
|| eap->cmdidx == CMD_laddbuffer) || eap->cmdidx == CMD_laddbuffer)
@@ -5509,20 +5501,19 @@ ex_cbuffer(exarg_T *eap)
qf_title = IObuff; qf_title = IObuff;
} }
if (qf_init_ext(qi, qi->qf_curlist, NULL, buf, NULL, p_efm, res = qf_init_ext(qi, qi->qf_curlist, NULL, buf, NULL, p_efm,
(eap->cmdidx != CMD_caddbuffer (eap->cmdidx != CMD_caddbuffer
&& eap->cmdidx != CMD_laddbuffer), && eap->cmdidx != CMD_laddbuffer),
eap->line1, eap->line2, eap->line1, eap->line2,
qf_title, NULL) > 0) qf_title, NULL);
{
#ifdef FEAT_AUTOCMD #ifdef FEAT_AUTOCMD
if (au_name != NULL) if (au_name != NULL)
apply_autocmds(EVENT_QUICKFIXCMDPOST, au_name, apply_autocmds(EVENT_QUICKFIXCMDPOST, au_name,
curbuf->b_fname, TRUE, curbuf); curbuf->b_fname, TRUE, curbuf);
#endif #endif
if (eap->cmdidx == CMD_cbuffer || eap->cmdidx == CMD_lbuffer) if (res > 0 && (eap->cmdidx == CMD_cbuffer ||
qf_jump(qi, 0, 0, eap->forceit); /* display first error */ eap->cmdidx == CMD_lbuffer))
} qf_jump(qi, 0, 0, eap->forceit); /* display first error */
} }
} }
} }
@@ -5540,6 +5531,7 @@ ex_cexpr(exarg_T *eap)
#ifdef FEAT_AUTOCMD #ifdef FEAT_AUTOCMD
char_u *au_name = NULL; char_u *au_name = NULL;
#endif #endif
int res;
if (eap->cmdidx == CMD_lexpr || eap->cmdidx == CMD_lgetexpr if (eap->cmdidx == CMD_lexpr || eap->cmdidx == CMD_lgetexpr
|| eap->cmdidx == CMD_laddexpr) || eap->cmdidx == CMD_laddexpr)
@@ -5578,20 +5570,19 @@ ex_cexpr(exarg_T *eap)
if ((tv->v_type == VAR_STRING && tv->vval.v_string != NULL) if ((tv->v_type == VAR_STRING && tv->vval.v_string != NULL)
|| (tv->v_type == VAR_LIST && tv->vval.v_list != NULL)) || (tv->v_type == VAR_LIST && tv->vval.v_list != NULL))
{ {
if (qf_init_ext(qi, qi->qf_curlist, NULL, NULL, tv, p_efm, res = qf_init_ext(qi, qi->qf_curlist, NULL, NULL, tv, p_efm,
(eap->cmdidx != CMD_caddexpr (eap->cmdidx != CMD_caddexpr
&& eap->cmdidx != CMD_laddexpr), && eap->cmdidx != CMD_laddexpr),
(linenr_T)0, (linenr_T)0, *eap->cmdlinep, (linenr_T)0, (linenr_T)0, *eap->cmdlinep,
NULL) > 0) NULL);
{
#ifdef FEAT_AUTOCMD #ifdef FEAT_AUTOCMD
if (au_name != NULL) if (au_name != NULL)
apply_autocmds(EVENT_QUICKFIXCMDPOST, au_name, apply_autocmds(EVENT_QUICKFIXCMDPOST, au_name,
curbuf->b_fname, TRUE, curbuf); curbuf->b_fname, TRUE, curbuf);
#endif #endif
if (eap->cmdidx == CMD_cexpr || eap->cmdidx == CMD_lexpr) if (res > 0 && (eap->cmdidx == CMD_cexpr ||
qf_jump(qi, 0, 0, eap->forceit); /* display first error */ eap->cmdidx == CMD_lexpr))
} qf_jump(qi, 0, 0, eap->forceit); /* display first error */
} }
else else
EMSG(_("E777: String or List expected")); EMSG(_("E777: String or List expected"));

View File

@@ -8058,8 +8058,11 @@ screen_start_highlight(int attr)
out_str(T_ME); out_str(T_ME);
if ((attr & HL_STANDOUT) && T_SO != NULL) /* standout */ if ((attr & HL_STANDOUT) && T_SO != NULL) /* standout */
out_str(T_SO); out_str(T_SO);
if ((attr & (HL_UNDERLINE | HL_UNDERCURL)) && T_US != NULL) if ((attr & HL_UNDERCURL) && T_UCS != NULL) /* undercurl */
/* underline or undercurl */ out_str(T_UCS);
if (((attr & HL_UNDERLINE) /* underline or undercurl */
|| ((attr & HL_UNDERCURL) && T_UCS == NULL))
&& T_US != NULL)
out_str(T_US); out_str(T_US);
if ((attr & HL_ITALIC) && T_CZH != NULL) /* italic */ if ((attr & HL_ITALIC) && T_CZH != NULL) /* italic */
out_str(T_CZH); out_str(T_CZH);
@@ -8177,7 +8180,15 @@ screen_stop_highlight(void)
else else
out_str(T_SE); out_str(T_SE);
} }
if (screen_attr & (HL_UNDERLINE | HL_UNDERCURL)) if ((screen_attr & HL_UNDERCURL) && T_UCE != NULL)
{
if (STRCMP(T_UCE, T_ME) == 0)
do_ME = TRUE;
else
out_str(T_UCE);
}
if ((screen_attr & HL_UNDERLINE)
|| ((screen_attr & HL_UNDERCURL) && T_UCE == NULL))
{ {
if (STRCMP(T_UE, T_ME) == 0) if (STRCMP(T_UE, T_ME) == 0)
do_ME = TRUE; do_ME = TRUE;

View File

@@ -38,6 +38,8 @@
* in tl_scrollback are no longer used. * in tl_scrollback are no longer used.
* *
* TODO: * TODO:
* - When using 'termguicolors' still use the 16 ANSI colors as-is. Helps for
* a job that uses 16 colors while Vim is using > 256.
* - in GUI vertical split causes problems. Cursor is flickering. (Hirohito * - in GUI vertical split causes problems. Cursor is flickering. (Hirohito
* Higashi, 2017 Sep 19) * Higashi, 2017 Sep 19)
* - Shift-Tab does not work. * - Shift-Tab does not work.
@@ -48,7 +50,6 @@
* - When closing gvim with an active terminal buffer, the dialog suggests * - When closing gvim with an active terminal buffer, the dialog suggests
* saving the buffer. Should say something else. (Manas Thakur, #2215) * saving the buffer. Should say something else. (Manas Thakur, #2215)
* Also: #2223 * Also: #2223
* - implement term_setsize()
* - Termdebug does not work when Vim build with mzscheme. gdb hangs. * - Termdebug does not work when Vim build with mzscheme. gdb hangs.
* - MS-Windows GUI: WinBar has tearoff item * - MS-Windows GUI: WinBar has tearoff item
* - Adding WinBar to terminal window doesn't display, text isn't shifted down. * - Adding WinBar to terminal window doesn't display, text isn't shifted down.
@@ -57,6 +58,7 @@
* - What to store in a session file? Shell at the prompt would be OK to * - What to store in a session file? Shell at the prompt would be OK to
* restore, but others may not. Open the window and let the user start the * restore, but others may not. Open the window and let the user start the
* command? * command?
* - implement term_setsize()
* - add test for giving error for invalid 'termsize' value. * - add test for giving error for invalid 'termsize' value.
* - support minimal size when 'termsize' is "rows*cols". * - support minimal size when 'termsize' is "rows*cols".
* - support minimal size when 'termsize' is empty? * - support minimal size when 'termsize' is empty?
@@ -1707,7 +1709,7 @@ may_toggle_cursor(term_T *term)
/* /*
* Reverse engineer the RGB value into a cterm color index. * Reverse engineer the RGB value into a cterm color index.
* First color is 1. Return 0 if no match found. * First color is 1. Return 0 if no match found (default color).
*/ */
static int static int
color2index(VTermColor *color, int fg, int *boldp) color2index(VTermColor *color, int fg, int *boldp)
@@ -1716,78 +1718,34 @@ color2index(VTermColor *color, int fg, int *boldp)
int blue = color->blue; int blue = color->blue;
int green = color->green; int green = color->green;
/* The argument for lookup_color() is for the color_names[] table. */ if (color->ansi_index != VTERM_ANSI_INDEX_NONE)
if (red == 0)
{ {
if (green == 0) /* First 16 colors and default: use the ANSI index, because these
* colors can be redefined. */
if (t_colors >= 16)
return color->ansi_index;
switch (color->ansi_index)
{ {
if (blue == 0) case 0: return 0;
return lookup_color(0, fg, boldp) + 1; /* black */ case 1: return lookup_color( 0, fg, boldp) + 1;
if (blue == 224) case 2: return lookup_color( 4, fg, boldp) + 1; /* dark red */
return lookup_color(1, fg, boldp) + 1; /* dark blue */ case 3: return lookup_color( 2, fg, boldp) + 1; /* dark green */
} case 4: return lookup_color( 6, fg, boldp) + 1; /* brown */
else if (green == 224) case 5: return lookup_color( 1, fg, boldp) + 1; /* dark blue*/
{ case 6: return lookup_color( 5, fg, boldp) + 1; /* dark magenta */
if (blue == 0) case 7: return lookup_color( 3, fg, boldp) + 1; /* dark cyan */
return lookup_color(2, fg, boldp) + 1; /* dark green */ case 8: return lookup_color( 8, fg, boldp) + 1; /* light grey */
if (blue == 224) case 9: return lookup_color(12, fg, boldp) + 1; /* dark grey */
return lookup_color(3, fg, boldp) + 1; /* dark cyan */ 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 */
else if (red == 224) case 13: return lookup_color(14, fg, boldp) + 1; /* blue */
{ case 14: return lookup_color(22, fg, boldp) + 1; /* magenta */
if (green == 0) case 15: return lookup_color(18, fg, boldp) + 1; /* cyan */
{ case 16: return lookup_color(26, fg, boldp) + 1; /* white */
if (blue == 0)
return lookup_color(4, fg, boldp) + 1; /* dark red */
if (blue == 224)
return lookup_color(5, fg, boldp) + 1; /* dark magenta */
}
else if (green == 224)
{
if (blue == 0)
return lookup_color(6, fg, boldp) + 1; /* dark yellow / brown */
if (blue == 224)
return lookup_color(8, fg, boldp) + 1; /* white / light grey */
}
}
else if (red == 128)
{
if (green == 128 && blue == 128)
return lookup_color(12, fg, boldp) + 1; /* dark grey */
}
else if (red == 255)
{
if (green == 64)
{
if (blue == 64)
return lookup_color(20, fg, boldp) + 1; /* light red */
if (blue == 255)
return lookup_color(22, fg, boldp) + 1; /* light magenta */
}
else if (green == 255)
{
if (blue == 64)
return lookup_color(24, fg, boldp) + 1; /* yellow */
if (blue == 255)
return lookup_color(26, fg, boldp) + 1; /* white */
}
}
else if (red == 64)
{
if (green == 64)
{
if (blue == 255)
return lookup_color(14, fg, boldp) + 1; /* light blue */
}
else if (green == 255)
{
if (blue == 64)
return lookup_color(16, fg, boldp) + 1; /* light green */
if (blue == 255)
return lookup_color(18, fg, boldp) + 1; /* light cyan */
} }
} }
if (t_colors >= 256) if (t_colors >= 256)
{ {
if (red == blue && red == green) if (red == blue && red == green)
@@ -1875,6 +1833,23 @@ cell2attr(VTermScreenCellAttrs cellattrs, VTermColor cellfg, VTermColor cellbg)
int fg = color2index(&cellfg, TRUE, &bold); int fg = color2index(&cellfg, TRUE, &bold);
int bg = color2index(&cellbg, FALSE, &bold); int bg = color2index(&cellbg, FALSE, &bold);
/* Use the "Terminal" highlighting for the default colors. */
if (fg == 0 || bg == 0)
{
int id = syn_name2id((char_u *)"Terminal");
if (id != 0 && t_colors >= 16)
{
int cterm_fg, cterm_bg;
syn_id2cterm_bg(id, &cterm_fg, &cterm_bg);
if (cterm_fg >= 0)
fg = cterm_fg + 1;
if (cterm_bg >= 0)
bg = cterm_bg + 1;
}
}
/* with 8 colors set the bold attribute to get a bright foreground */ /* with 8 colors set the bold attribute to get a bright foreground */
if (bold == TRUE) if (bold == TRUE)
attr |= HL_BOLD; attr |= HL_BOLD;
@@ -2447,23 +2422,23 @@ term_get_attr(buf_T *buf, linenr_T lnum, int col)
} }
static VTermColor ansi_table[16] = { static VTermColor ansi_table[16] = {
{ 0, 0, 0}, /* black */ { 0, 0, 0, 1}, /* black */
{224, 0, 0}, /* dark red */ {224, 0, 0, 2}, /* dark red */
{ 0, 224, 0}, /* dark green */ { 0, 224, 0, 3}, /* dark green */
{224, 224, 0}, /* dark yellow / brown */ {224, 224, 0, 4}, /* dark yellow / brown */
{ 0, 0, 224}, /* dark blue */ { 0, 0, 224, 5}, /* dark blue */
{224, 0, 224}, /* dark magenta */ {224, 0, 224, 6}, /* dark magenta */
{ 0, 224, 224}, /* dark cyan */ { 0, 224, 224, 7}, /* dark cyan */
{224, 224, 224}, /* light grey */ {224, 224, 224, 8}, /* light grey */
{128, 128, 128}, /* dark grey */ {128, 128, 128, 9}, /* dark grey */
{255, 64, 64}, /* light red */ {255, 64, 64, 10}, /* light red */
{ 64, 255, 64}, /* light green */ { 64, 255, 64, 11}, /* light green */
{255, 255, 64}, /* yellow */ {255, 255, 64, 12}, /* yellow */
{ 64, 64, 255}, /* light blue */ { 64, 64, 255, 13}, /* light blue */
{255, 64, 255}, /* light magenta */ {255, 64, 255, 14}, /* light magenta */
{ 64, 255, 255}, /* light cyan */ { 64, 255, 255, 15}, /* light cyan */
{255, 255, 255}, /* white */ {255, 255, 255, 16}, /* white */
}; };
static int cube_value[] = { static int cube_value[] = {
@@ -2549,7 +2524,7 @@ create_vterm(term_T *term, int rows, int cols)
/* The "Terminal" highlight group overrules the defaults. */ /* The "Terminal" highlight group overrules the defaults. */
id = syn_name2id((char_u *)"Terminal"); id = syn_name2id((char_u *)"Terminal");
/* Use the actual color for the GUI and when 'guitermcolors' is set. */ /* Use the actual color for the GUI and when 'termguicolors' is set. */
#if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) #if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)
if (0 if (0
# ifdef FEAT_GUI # ifdef FEAT_GUI

View File

@@ -375,6 +375,29 @@ func Test_diffopt_vertical()
%bwipe %bwipe
endfunc endfunc
func Test_diffopt_hiddenoff()
set diffopt=filler,foldcolumn:0,hiddenoff
e! one
call setline(1, ['Two', 'Three'])
redraw
let normattr = screenattr(1, 1)
diffthis
botright vert new two
call setline(1, ['One', 'Four'])
diffthis
redraw
call assert_notequal(normattr, screenattr(1, 1))
set hidden
close
redraw
" should not diffing with hidden buffer two while 'hiddenoff' is enabled
call assert_equal(normattr, screenattr(1, 1))
bwipe!
bwipe!
set hidden& diffopt&
endfunc
func Test_diffoff_hidden() func Test_diffoff_hidden()
set diffopt=filler,foldcolumn:0 set diffopt=filler,foldcolumn:0
e! one e! one

View File

@@ -1966,26 +1966,136 @@ func Test_Autocmd()
cexpr "F1:10:Line 10" cexpr "F1:10:Line 10"
caddexpr "F1:20:Line 20" caddexpr "F1:20:Line 20"
cgetexpr "F1:30:Line 30" cgetexpr "F1:30:Line 30"
enew! | call append(0, "F2:10:Line 10") cexpr ""
cbuffer! caddexpr ""
enew! | call append(0, "F2:20:Line 20") cgetexpr ""
cgetbuffer silent! cexpr non_existing_func()
enew! | call append(0, "F2:30:Line 30") silent! caddexpr non_existing_func()
caddbuffer silent! cgetexpr non_existing_func()
let l = ['precexpr', let l = ['precexpr',
\ 'postcexpr', \ 'postcexpr',
\ 'precaddexpr', \ 'precaddexpr',
\ 'postcaddexpr', \ 'postcaddexpr',
\ 'precgetexpr', \ 'precgetexpr',
\ 'postcgetexpr', \ 'postcgetexpr',
\ 'precbuffer', \ 'precexpr',
\ 'postcexpr',
\ 'precaddexpr',
\ 'postcaddexpr',
\ 'precgetexpr',
\ 'postcgetexpr',
\ 'precexpr',
\ 'precaddexpr',
\ 'precgetexpr']
call assert_equal(l, g:acmds)
let g:acmds = []
enew! | call append(0, "F2:10:Line 10")
cbuffer!
enew! | call append(0, "F2:20:Line 20")
cgetbuffer
enew! | call append(0, "F2:30:Line 30")
caddbuffer
new
let bnum = bufnr('%')
bunload
exe 'silent! cbuffer! ' . bnum
exe 'silent! cgetbuffer ' . bnum
exe 'silent! caddbuffer ' . bnum
enew!
let l = ['precbuffer',
\ 'postcbuffer', \ 'postcbuffer',
\ 'precgetbuffer', \ 'precgetbuffer',
\ 'postcgetbuffer', \ 'postcgetbuffer',
\ 'precaddbuffer', \ 'precaddbuffer',
\ 'postcaddbuffer'] \ 'postcaddbuffer',
\ 'precbuffer',
\ 'precgetbuffer',
\ 'precaddbuffer']
call assert_equal(l, g:acmds) call assert_equal(l, g:acmds)
call writefile(['Xtest:1:Line1'], 'Xtest')
call writefile([], 'Xempty')
let g:acmds = []
cfile Xtest
caddfile Xtest
cgetfile Xtest
cfile Xempty
caddfile Xempty
cgetfile Xempty
silent! cfile do_not_exist
silent! caddfile do_not_exist
silent! cgetfile do_not_exist
let l = ['precfile',
\ 'postcfile',
\ 'precaddfile',
\ 'postcaddfile',
\ 'precgetfile',
\ 'postcgetfile',
\ 'precfile',
\ 'postcfile',
\ 'precaddfile',
\ 'postcaddfile',
\ 'precgetfile',
\ 'postcgetfile',
\ 'precfile',
\ 'postcfile',
\ 'precaddfile',
\ 'postcaddfile',
\ 'precgetfile',
\ 'postcgetfile']
call assert_equal(l, g:acmds)
let g:acmds = []
helpgrep quickfix
silent! helpgrep non_existing_help_topic
vimgrep test Xtest
vimgrepadd test Xtest
silent! vimgrep non_existing_test Xtest
silent! vimgrepadd non_existing_test Xtest
set makeprg=
silent! make
set makeprg&
let l = ['prehelpgrep',
\ 'posthelpgrep',
\ 'prehelpgrep',
\ 'posthelpgrep',
\ 'previmgrep',
\ 'postvimgrep',
\ 'previmgrepadd',
\ 'postvimgrepadd',
\ 'previmgrep',
\ 'postvimgrep',
\ 'previmgrepadd',
\ 'postvimgrepadd',
\ 'premake',
\ 'postmake']
call assert_equal(l, g:acmds)
if has('unix')
" Run this test only on Unix-like systems. The grepprg may not be set on
" non-Unix systems.
" The following lines are used for the grep test. Don't remove.
" Grep_Autocmd_Text: Match 1
" GrepAdd_Autocmd_Text: Match 2
let g:acmds = []
silent grep Grep_Autocmd_Text test_quickfix.vim
silent grepadd GrepAdd_Autocmd_Text test_quickfix.vim
silent grep abc123def Xtest
silent grepadd abc123def Xtest
let l = ['pregrep',
\ 'postgrep',
\ 'pregrepadd',
\ 'postgrepadd',
\ 'pregrep',
\ 'postgrep',
\ 'pregrepadd',
\ 'postgrepadd']
call assert_equal(l, g:acmds)
endif
call delete('Xtest')
call delete('Xempty')
endfunc endfunc
func Test_Autocmd_Exception() func Test_Autocmd_Exception()

View File

@@ -771,6 +771,24 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1361,
/**/
1360,
/**/
1359,
/**/
1358,
/**/
1357,
/**/
1356,
/**/
1355,
/**/
1354,
/**/
1353,
/**/ /**/
1352, 1352,
/**/ /**/

View File

@@ -2485,7 +2485,8 @@ typedef enum {
#define FNE_INCL_BR 1 /* include [] in name */ #define FNE_INCL_BR 1 /* include [] in name */
#define FNE_CHECK_START 2 /* check name starts with valid character */ #define FNE_CHECK_START 2 /* check name starts with valid character */
#if (defined(SUN_SYSTEM) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) \ /* BSD is supposed to cover FreeBSD and similar systems. */
#if (defined(SUN_SYSTEM) || defined(BSD) || defined(__FreeBSD_kernel__)) \
&& defined(S_ISCHR) && defined(S_ISCHR)
# define OPEN_CHR_FILES # define OPEN_CHR_FILES
#endif #endif