summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-03-24 15:09:13 +0100
committerBram Moolenaar <Bram@vim.org>2019-03-24 15:09:13 +0100
commit63b74a8362b14576b21d342dc424d0396ca8ea27 (patch)
treeef1a162503974f7209058ad2430484c892409344 /runtime
parentdb77b84ac2b6373ae4200d47945fc6ca64337e31 (diff)
downloadvim-git-63b74a8362b14576b21d342dc424d0396ca8ea27.tar.gz
Update runtime files.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/autoload/dist/ft.vim2
-rw-r--r--runtime/doc/channel.txt9
-rw-r--r--runtime/doc/eval.txt4
-rw-r--r--runtime/doc/index.txt7
-rw-r--r--runtime/doc/options.txt14
-rw-r--r--runtime/doc/tags3
-rw-r--r--runtime/doc/tagsrch.txt5
-rw-r--r--runtime/doc/todo.txt27
-rw-r--r--runtime/doc/various.txt4
-rw-r--r--runtime/filetype.vim6
-rw-r--r--runtime/ftplugin/cobol.vim5
-rw-r--r--runtime/ftplugin/python.vim133
-rw-r--r--runtime/indent/cobol.vim11
-rw-r--r--runtime/indent/html.vim11
-rw-r--r--runtime/indent/sh.vim4
-rw-r--r--runtime/indent/testdir/README.txt6
-rw-r--r--runtime/indent/testdir/html.ok6
-rw-r--r--runtime/indent/testdir/runtest.vim2
-rw-r--r--runtime/indent/testdir/xml.ok4
-rw-r--r--runtime/indent/xml.vim63
-rw-r--r--runtime/syntax/cobol.vim164
21 files changed, 345 insertions, 145 deletions
diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim
index a97bad3b5..e85ffc763 100644
--- a/runtime/autoload/dist/ft.vim
+++ b/runtime/autoload/dist/ft.vim
@@ -1,7 +1,7 @@
" Vim functions for file type detection
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2019 Jan 18
+" Last Change: 2019 Mar 08
" These functions are moved here from runtime/filetype.vim to make startup
" faster.
diff --git a/runtime/doc/channel.txt b/runtime/doc/channel.txt
index fd08cd497..cb6f78180 100644
--- a/runtime/doc/channel.txt
+++ b/runtime/doc/channel.txt
@@ -1,4 +1,4 @@
-*channel.txt* For Vim version 8.1. Last change: 2018 Apr 18
+*channel.txt* For Vim version 8.1. Last change: 2019 Mar 21
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -308,9 +308,10 @@ higher.
Command "redraw" ~
-The other commands do not update the screen, so that you can send a sequence
-of commands without the cursor moving around. You must end with the "redraw"
-command to show any changed text and show the cursor where it belongs.
+The other commands do not explicitly update the screen, so that you can send a
+sequence of commands without the cursor moving around. A redraw can happen as
+a side effect of some commands. You must end with the "redraw" command to
+show any changed text and show the cursor where it belongs.
The argument is normally an empty string:
["redraw", ""] ~
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 623872326..1294481da 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,4 +1,4 @@
-*eval.txt* For Vim version 8.1. Last change: 2019 Mar 02
+*eval.txt* For Vim version 8.1. Last change: 2019 Mar 23
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -10337,8 +10337,6 @@ tag_binary Compiled with binary searching in tags files
|tag-binary-search|.
tag_old_static Compiled with support for old static tags
|tag-old-static|.
-tag_any_white Compiled with support for any white characters in tags
- files |tag-any-white|.
tcl Compiled with Tcl interface.
termguicolors Compiled with true color in terminal support.
terminal Compiled with |terminal| support.
diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt
index 2406a279a..ca52a3454 100644
--- a/runtime/doc/index.txt
+++ b/runtime/doc/index.txt
@@ -1,4 +1,4 @@
-*index.txt* For Vim version 8.1. Last change: 2019 Mar 17
+*index.txt* For Vim version 8.1. Last change: 2019 Mar 21
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1042,10 +1042,11 @@ tag command action in Command-line editing mode ~
command-line from history.
|c_CTRL-Q| CTRL-Q same as CTRL-V, unless it's used for terminal
control flow
-|c_CTRL-R| CTRL-R {0-9a-z"%#*:= CTRL-F CTRL-P CTRL-W CTRL-A}
+|c_CTRL-R| CTRL-R {regname}
insert the contents of a register or object
under the cursor as if typed
-|c_CTRL-R_CTRL-R| CTRL-R CTRL-R {0-9a-z"%#*:= CTRL-F CTRL-P CTRL-W CTRL-A}
+|c_CTRL-R_CTRL-R| CTRL-R CTRL-R {regname}
+|c_CTRL-R_CTRL-O| CTRL-R CTRL-O {regname}
insert the contents of a register or object
under the cursor literally
CTRL-S (used for terminal control flow)
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 97dbb5af1..66a9e17f4 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,4 +1,4 @@
-*options.txt* For Vim version 8.1. Last change: 2019 Mar 08
+*options.txt* For Vim version 8.1. Last change: 2019 Mar 24
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2538,7 +2538,15 @@ A jump table for the options with a short description can be found at |Q_op|.
The default value is for C programs. For C++ this value would be
useful, to include const type declarations: >
^\(#\s*define\|[a-z]*\s*const\s*[a-z]*\)
+< You can also use "\ze" just before the name and continue the pattern
+ to check what is following. E.g. for Javascript, if a function is
+ defined with "func_name = function(args)": >
+ ^\s*\ze\i\+\s*=\s*function(
+< If the function is defined with "func_name : function() {...": >
+ ^\s*\ze\i\+\s*[:]\s*(*function\s*(
< When using the ":set" command, you need to double the backslashes!
+ To avoid that use `:let` with a single quote string: >
+ let &l:define = '^\s*\ze\k\+\s*=\s*function('
*'delcombine'* *'deco'* *'nodelcombine'* *'nodeco'*
'delcombine' 'deco' boolean (default off)
@@ -7682,7 +7690,9 @@ A jump table for the options with a short description can be found at |Q_op|.
pages.
split If included, split the current window before loading
a buffer for a |quickfix| command that display errors.
- Otherwise: do not split, use current window.
+ Otherwise: do not split, use current window (when used
+ in the quickfix window: the previously used window or
+ split if there is no other window).
vsplit Just like "split" but split vertically.
newtab Like "split", but open a new tab page. Overrules
"split" when both are present.
diff --git a/runtime/doc/tags b/runtime/doc/tags
index a9df438c2..f3726e9cc 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -7401,6 +7401,7 @@ love intro.txt /*love*
lowercase change.txt /*lowercase*
lpc.vim syntax.txt /*lpc.vim*
lua if_lua.txt /*lua*
+lua-blob if_lua.txt /*lua-blob*
lua-buffer if_lua.txt /*lua-buffer*
lua-commands if_lua.txt /*lua-commands*
lua-dict if_lua.txt /*lua-dict*
@@ -9023,7 +9024,6 @@ tabpagenr() eval.txt /*tabpagenr()*
tabpagewinnr() eval.txt /*tabpagewinnr()*
tag tagsrch.txt /*tag*
tag-! tagsrch.txt /*tag-!*
-tag-any-white tagsrch.txt /*tag-any-white*
tag-binary-search tagsrch.txt /*tag-binary-search*
tag-blocks motion.txt /*tag-blocks*
tag-commands tagsrch.txt /*tag-commands*
@@ -9203,6 +9203,7 @@ test_null_partial() eval.txt /*test_null_partial()*
test_null_string() eval.txt /*test_null_string()*
test_option_not_set() eval.txt /*test_option_not_set()*
test_override() eval.txt /*test_override()*
+test_refcount() eval.txt /*test_refcount()*
test_scrollbar() eval.txt /*test_scrollbar()*
test_settime() eval.txt /*test_settime()*
testing eval.txt /*testing*
diff --git a/runtime/doc/tagsrch.txt b/runtime/doc/tagsrch.txt
index ef1e5158e..950fd62bd 100644
--- a/runtime/doc/tagsrch.txt
+++ b/runtime/doc/tagsrch.txt
@@ -1,4 +1,4 @@
-*tagsrch.txt* For Vim version 8.1. Last change: 2019 Feb 25
+*tagsrch.txt* For Vim version 8.1. Last change: 2019 Mar 23
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -558,8 +558,7 @@ only supported by new versions of ctags (such as Exuberant ctags).
be any identifier. It cannot contain a <Tab>.
{TAB} One <Tab> character. Note: previous versions allowed any
white space here. This has been abandoned to allow spaces in
- {tagfile}. It can be re-enabled by including the
- |+tag_any_white| feature at compile time. *tag-any-white*
+ {tagfile}.
{tagfile} The file that contains the definition of {tagname}. It can
have an absolute or relative path. It may contain environment
variables and wildcards (although the use of wildcards is
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index 7f512ea4c..d3318eee4 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt* For Vim version 8.1. Last change: 2019 Mar 14
+*todo.txt* For Vim version 8.1. Last change: 2019 Mar 23
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -38,16 +38,6 @@ browser use: https://github.com/vim/vim/issues/1234
*known-bugs*
-------------------- Known bugs and current work -----------------------
-Patch to add Farsi handling to arabic.c (Ali Gholami Rudi, 2009 May 2)
-Added test, updates, June 23.
-Updated for 7.4: http://litcave.rudi.ir/farsi_vim.diff
-Remark from Ameretat Reith (2014 Oct 13) with patch on top.
-Updated patch from Ameretat Reith, 2019 Mar 1.
-
-Timer test doesn't work on MS-Windows console, any way to make it work?
-
-Drop FEAT_TAG_ANYWHITE ? It should not be a compile time option.
-
'incsearch' with :s: (#3321)
- Get E20 when using command history to get "'<,'>s/a/b" and no Visual area
was set. (#3837)
@@ -121,6 +111,8 @@ Support for popup widows:
Adding "10" to 'spellsuggest' causes spell suggestions to become very slow.
(#4087)
+Patch to add complete_info() Shougo - #3866. Ready to include. Now #4106
+
Problem with Visual yank when 'linebreak' and 'showbreak' are set.
Patch with tests, but it's not clear how it is supposed to work. (tommm, 2018
Nov 17) Asked about this, Dec 22. Christian will have a look.
@@ -137,6 +129,8 @@ Test doesn't fail without patch?
Patch to add ruby cflags. (#4050, fixes #1081)
Needs modification.
+Patch to add src/README.md. (WenxuanHuang, #4141) Replace README.txt?
+
Crash when mixing matchadd and substitute()? (Max Christian Pohle, 2018 May
13, #2910) Can't reproduce?
@@ -224,6 +218,9 @@ Patch on the issue by Hongbo Liu, 2019 Feb 19 #4013
More warnings from static analysis:
https://lgtm.com/projects/g/vim/vim/alerts/?mode=list
+Drop FEAT_TAG_OLDSTATIC? Anybody using this format should be able to get a
+newer version of ctags.
+
Still a E315 error when using terminal. (Masato Nishihata, #3959)
When using 'k' in 'guioptions' gvim may open with a tiny window. (#3808)
@@ -231,9 +228,15 @@ Suggested patch on the issue.
nvo-mode mapping works on Windows, not on Linux. (#3678)
+Patch to have tutor check $LC_MESSAGES. (#4112)
+
Patch to fix modify_fname() does not work well with some 'encoding's.
(Ken Takata, #4007)
+Patch to add more info to OptionSet. Should mention what triggered the change
+":set", ":setlocal", ":setglobal", "modeline"; and the old global value.
+#4118
+
Patch to make vim_getenv() work with wide API. (Ken Takata, #4008)
How to make (async) complete function depending on completion type?
@@ -315,8 +318,6 @@ Invalid memory access with old regexp engine. (Dominique Pelle, 2018 Sep 3,
#3405) Introduced by 8.0.1517, which was fixing another memory access error.
(Sep 8)
-Patch to add complete_info Shougo - #3866. Ready to include.
-
Patch to make winnr() return the window above/below/beside a window.
(Yegappan Lakshmanan, #3993)
diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt
index eb50bdc17..428a7348e 100644
--- a/runtime/doc/various.txt
+++ b/runtime/doc/various.txt
@@ -1,4 +1,4 @@
-*various.txt* For Vim version 8.1. Last change: 2019 Jan 17
+*various.txt* For Vim version 8.1. Last change: 2019 Mar 23
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -443,7 +443,7 @@ N *+syntax* Syntax highlighting |syntax|
*+system()* Unix only: opposite of |+fork|
T *+tag_binary* binary searching in tags file |tag-binary-search|
N *+tag_old_static* old method for static tags |tag-old-static|
-m *+tag_any_white* any white space allowed in tags file |tag-any-white|
+m *+tag_any_white* Removed; was to allow any white space in tags files
m *+tcl* Tcl interface |tcl|
m *+tcl/dyn* Tcl interface |tcl-dynamic| |/dyn|
m *+terminal* Support for terminal window |terminal|
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index 26f548324..cc4faf72e 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2019 Feb 07
+" Last Change: 2019 Mar 19
" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
@@ -1617,6 +1617,10 @@ au BufNewFile,BufRead */etc/sysctl.conf,*/etc/sysctl.d/*.conf setf sysctl
" Systemd unit files
au BufNewFile,BufRead */systemd/*.{automount,mount,path,service,socket,swap,target,timer} setf systemd
+" Systemd overrides
+au BufNewFile,BufRead /etc/systemd/system/*.d/*.conf setf systemd
+" Systemd temp files
+au BufNewFile,BufRead /etc/systemd/system/*.d/.#* setf systemd
" Synopsys Design Constraints
au BufNewFile,BufRead *.sdc setf sdc
diff --git a/runtime/ftplugin/cobol.vim b/runtime/ftplugin/cobol.vim
index 11ad3ad72..d96a1bf28 100644
--- a/runtime/ftplugin/cobol.vim
+++ b/runtime/ftplugin/cobol.vim
@@ -1,7 +1,8 @@
" Vim filetype plugin file
" Language: cobol
-" Author: Tim Pope <vimNOSPAM@tpope.info>
-" Last Update: By ZyX: use shiftwidth()
+" Maintainer: Ankit Jain <ajatkj@yahoo.co.in>
+" (formerly Tim Pope <vimNOSPAM@tpope.info>)
+" Last Update: By Ankit Jain (changed maintainer) on 22.03.2019
" Insert mode mappings: <C-T> <C-D> <Tab>
" Normal mode mappings: < > << >> [[ ]] [] ][
diff --git a/runtime/ftplugin/python.vim b/runtime/ftplugin/python.vim
index 5c4a59b1a..64c1a87a6 100644
--- a/runtime/ftplugin/python.vim
+++ b/runtime/ftplugin/python.vim
@@ -3,7 +3,7 @@
" Maintainer: Tom Picton <tom@tompicton.co.uk>
" Previous Maintainer: James Sully <sullyj3@gmail.com>
" Previous Maintainer: Johannes Zellner <johannes@zellner.org>
-" Last Change: Sun, 15 April 2018
+" Last Change: Sun 17 Mar 2019
" https://github.com/tpict/vim-ftplugin-python
if exists("b:did_ftplugin") | finish | endif
@@ -37,9 +37,10 @@ setlocal suffixesadd=.py
setlocal comments=b:#,fb:-
setlocal commentstring=#\ %s
-setlocal omnifunc=pythoncomplete#Complete
if has('python3')
- setlocal omnifunc=python3complete#Complete
+ setlocal omnifunc=python3complete#Complete
+elseif has('python')
+ setlocal omnifunc=pythoncomplete#Complete
endif
set wildignore+=*.pyc
@@ -53,32 +54,34 @@ let b:prev='\v^\s*(class\|def\|async def)>'
let b:next_end='\v\S\n*(%$\|^(\s*\n*)*(class\|def\|async def)\|^\S)'
let b:prev_end='\v\S\n*(^(\s*\n*)*(class\|def\|async def)\|^\S)'
-execute "nnoremap <silent> <buffer> ]] :call <SID>Python_jump('n', '". b:next_toplevel."', 'W', v:count1)<cr>"
-execute "nnoremap <silent> <buffer> [[ :call <SID>Python_jump('n', '". b:prev_toplevel."', 'Wb', v:count1)<cr>"
-execute "nnoremap <silent> <buffer> ][ :call <SID>Python_jump('n', '". b:next_endtoplevel."', 'W', 0, v:count1)<cr>"
-execute "nnoremap <silent> <buffer> [] :call <SID>Python_jump('n', '". b:prev_endtoplevel."', 'Wb', 0, v:count1)<cr>"
-execute "nnoremap <silent> <buffer> ]m :call <SID>Python_jump('n', '". b:next."', 'W', v:count1)<cr>"
-execute "nnoremap <silent> <buffer> [m :call <SID>Python_jump('n', '". b:prev."', 'Wb', v:count1)<cr>"
-execute "nnoremap <silent> <buffer> ]M :call <SID>Python_jump('n', '". b:next_end."', 'W', 0, v:count1)<cr>"
-execute "nnoremap <silent> <buffer> [M :call <SID>Python_jump('n', '". b:prev_end."', 'Wb', 0, v:count1)<cr>"
-
-execute "onoremap <silent> <buffer> ]] :call <SID>Python_jump('o', '". b:next_toplevel."', 'W', v:count1)<cr>"
-execute "onoremap <silent> <buffer> [[ :call <SID>Python_jump('o', '". b:prev_toplevel."', 'Wb', v:count1)<cr>"
-execute "onoremap <silent> <buffer> ][ :call <SID>Python_jump('o', '". b:next_endtoplevel."', 'W', 0, v:count1)<cr>"
-execute "onoremap <silent> <buffer> [] :call <SID>Python_jump('o', '". b:prev_endtoplevel."', 'Wb', 0, v:count1)<cr>"
-execute "onoremap <silent> <buffer> ]m :call <SID>Python_jump('o', '". b:next."', 'W', v:count1)<cr>"
-execute "onoremap <silent> <buffer> [m :call <SID>Python_jump('o', '". b:prev."', 'Wb', v:count1)<cr>"
-execute "onoremap <silent> <buffer> ]M :call <SID>Python_jump('o', '". b:next_end."', 'W', 0, v:count1)<cr>"
-execute "onoremap <silent> <buffer> [M :call <SID>Python_jump('o', '". b:prev_end."', 'Wb', 0, v:count1)<cr>"
-
-execute "xnoremap <silent> <buffer> ]] :call <SID>Python_jump('x', '". b:next_toplevel."', 'W', v:count1)<cr>"
-execute "xnoremap <silent> <buffer> [[ :call <SID>Python_jump('x', '". b:prev_toplevel."', 'Wb', v:count1)<cr>"
-execute "xnoremap <silent> <buffer> ][ :call <SID>Python_jump('x', '". b:next_endtoplevel."', 'W', 0, v:count1)<cr>"
-execute "xnoremap <silent> <buffer> [] :call <SID>Python_jump('x', '". b:prev_endtoplevel."', 'Wb', 0, v:count1)<cr>"
-execute "xnoremap <silent> <buffer> ]m :call <SID>Python_jump('x', '". b:next."', 'W', v:count1)<cr>"
-execute "xnoremap <silent> <buffer> [m :call <SID>Python_jump('x', '". b:prev."', 'Wb', v:count1)<cr>"
-execute "xnoremap <silent> <buffer> ]M :call <SID>Python_jump('x', '". b:next_end."', 'W', 0, v:count1)<cr>"
-execute "xnoremap <silent> <buffer> [M :call <SID>Python_jump('x', '". b:prev_end."', 'Wb', 0, v:count1)<cr>"
+if !exists('g:no_plugin_maps') && !exists('g:no_python_maps')
+ execute "nnoremap <silent> <buffer> ]] :call <SID>Python_jump('n', '". b:next_toplevel."', 'W', v:count1)<cr>"
+ execute "nnoremap <silent> <buffer> [[ :call <SID>Python_jump('n', '". b:prev_toplevel."', 'Wb', v:count1)<cr>"
+ execute "nnoremap <silent> <buffer> ][ :call <SID>Python_jump('n', '". b:next_endtoplevel."', 'W', v:count1, 0)<cr>"
+ execute "nnoremap <silent> <buffer> [] :call <SID>Python_jump('n', '". b:prev_endtoplevel."', 'Wb', v:count1, 0)<cr>"
+ execute "nnoremap <silent> <buffer> ]m :call <SID>Python_jump('n', '". b:next."', 'W', v:count1)<cr>"
+ execute "nnoremap <silent> <buffer> [m :call <SID>Python_jump('n', '". b:prev."', 'Wb', v:count1)<cr>"
+ execute "nnoremap <silent> <buffer> ]M :call <SID>Python_jump('n', '". b:next_end."', 'W', v:count1, 0)<cr>"
+ execute "nnoremap <silent> <buffer> [M :call <SID>Python_jump('n', '". b:prev_end."', 'Wb', v:count1, 0)<cr>"
+
+ execute "onoremap <silent> <buffer> ]] :call <SID>Python_jump('o', '". b:next_toplevel."', 'W', v:count1)<cr>"
+ execute "onoremap <silent> <buffer> [[ :call <SID>Python_jump('o', '". b:prev_toplevel."', 'Wb', v:count1)<cr>"
+ execute "onoremap <silent> <buffer> ][ :call <SID>Python_jump('o', '". b:next_endtoplevel."', 'W', v:count1, 0)<cr>"
+ execute "onoremap <silent> <buffer> [] :call <SID>Python_jump('o', '". b:prev_endtoplevel."', 'Wb', v:count1, 0)<cr>"
+ execute "onoremap <silent> <buffer> ]m :call <SID>Python_jump('o', '". b:next."', 'W', v:count1)<cr>"
+ execute "onoremap <silent> <buffer> [m :call <SID>Python_jump('o', '". b:prev."', 'Wb', v:count1)<cr>"
+ execute "onoremap <silent> <buffer> ]M :call <SID>Python_jump('o', '". b:next_end."', 'W', v:count1, 0)<cr>"
+ execute "onoremap <silent> <buffer> [M :call <SID>Python_jump('o', '". b:prev_end."', 'Wb', v:count1, 0)<cr>"
+
+ execute "xnoremap <silent> <buffer> ]] :call <SID>Python_jump('x', '". b:next_toplevel."', 'W', v:count1)<cr>"
+ execute "xnoremap <silent> <buffer> [[ :call <SID>Python_jump('x', '". b:prev_toplevel."', 'Wb', v:count1)<cr>"
+ execute "xnoremap <silent> <buffer> ][ :call <SID>Python_jump('x', '". b:next_endtoplevel."', 'W', v:count1, 0)<cr>"
+ execute "xnoremap <silent> <buffer> [] :call <SID>Python_jump('x', '". b:prev_endtoplevel."', 'Wb', v:count1, 0)<cr>"
+ execute "xnoremap <silent> <buffer> ]m :call <SID>Python_jump('x', '". b:next."', 'W', v:count1)<cr>"
+ execute "xnoremap <silent> <buffer> [m :call <SID>Python_jump('x', '". b:prev."', 'Wb', v:count1)<cr>"
+ execute "xnoremap <silent> <buffer> ]M :call <SID>Python_jump('x', '". b:next_end."', 'W', v:count1, 0)<cr>"
+ execute "xnoremap <silent> <buffer> [M :call <SID>Python_jump('x', '". b:prev_end."', 'Wb', v:count1, 0)<cr>"
+endif
if !exists('*<SID>Python_jump')
fun! <SID>Python_jump(mode, motion, flags, count, ...) range
@@ -123,10 +126,80 @@ if !exists('g:pydoc_executable')
let g:pydoc_executable = 0
endif
endif
+
+" Windows-specific pydoc setup
+if has('win32') || has('win64')
+ if executable('python')
+ " available as Tools\scripts\pydoc.py
+ let g:pydoc_executable = 1
+ else
+ let g:pydoc_executable = 0
+ endif
+endif
+
" If "pydoc" was found use it for keywordprg.
if g:pydoc_executable
- setlocal keywordprg=pydoc
+ if has('win32') || has('win64')
+ setlocal keywordprg=python\ -m\ pydoc\
+ else
+ setlocal keywordprg=pydoc
+ endif
endif
+" Script for filetype switching to undo the local stuff we may have changed
+let b:undo_ftplugin = 'setlocal cinkeys<'
+ \ . '|setlocal comments<'
+ \ . '|setlocal commentstring<'
+ \ . '|setlocal expandtab<'
+ \ . '|setlocal include<'
+ \ . '|setlocal includeexpr<'
+ \ . '|setlocal indentkeys<'
+ \ . '|setlocal keywordprg<'
+ \ . '|setlocal omnifunc<'
+ \ . '|setlocal shiftwidth<'
+ \ . '|setlocal softtabstop<'
+ \ . '|setlocal suffixesadd<'
+ \ . '|setlocal tabstop<'
+ \ . '|silent! nunmap <buffer> [M'
+ \ . '|silent! nunmap <buffer> [['
+ \ . '|silent! nunmap <buffer> []'
+ \ . '|silent! nunmap <buffer> [m'
+ \ . '|silent! nunmap <buffer> ]M'
+ \ . '|silent! nunmap <buffer> ]['
+ \ . '|silent! nunmap <buffer> ]]'
+ \ . '|silent! nunmap <buffer> ]m'
+ \ . '|silent! ounmap <buffer> [M'
+ \ . '|silent! ounmap <buffer> [['
+ \ . '|silent! ounmap <buffer> []'
+ \ . '|silent! ounmap <buffer> [m'
+ \ . '|silent! ounmap <buffer> ]M'
+ \ . '|silent! ounmap <buffer> ]['
+ \ . '|silent! ounmap <buffer> ]]'
+ \ . '|silent! ounmap <buffer> ]m'
+ \ . '|silent! xunmap <buffer> [M'
+ \ . '|silent! xunmap <buffer> [['
+ \ . '|silent! xunmap <buffer> []'
+ \ . '|silent! xunmap <buffer> [m'
+ \ . '|silent! xunmap <buffer> ]M'
+ \ . '|silent! xunmap <buffer> ]['
+ \ . '|silent! xunmap <buffer> ]]'
+ \ . '|silent! xunmap <buffer> ]m'
+ \ . '|unlet! b:browsefilter'
+ \ . '|unlet! b:child_match'
+ \ . '|unlet! b:child_sub'
+ \ . '|unlet! b:grandparent_match'
+ \ . '|unlet! b:grandparent_sub'
+ \ . '|unlet! b:next'
+ \ . '|unlet! b:next_end'
+ \ . '|unlet! b:next_endtoplevel'
+ \ . '|unlet! b:next_toplevel'
+ \ . '|unlet! b:parent_match'
+ \ . '|unlet! b:parent_sub'
+ \ . '|unlet! b:prev'
+ \ . '|unlet! b:prev_end'
+ \ . '|unlet! b:prev_endtoplevel'
+ \ . '|unlet! b:prev_toplevel'
+ \ . '|unlet! b:undo_ftplugin'
+
let &cpo = s:keepcpo
unlet s:keepcpo
diff --git a/runtime/indent/cobol.vim b/runtime/indent/cobol.vim
index c08444ac4..590a729df 100644
--- a/runtime/indent/cobol.vim
+++ b/runtime/indent/cobol.vim
@@ -1,7 +1,12 @@
" Vim indent file
" Language: cobol
-" Author: Tim Pope <vimNOSPAM@tpope.info>
+" Maintainer: Ankit Jain <ajatkj@yahoo.co.in>
+" (formerly Tim Pope <vimNOSPAM@tpope.info>)
" $Id: cobol.vim,v 1.1 2007/05/05 18:08:19 vimboss Exp $
+" Last Update: By Ankit Jain on 22.03.2019
+" Ankit Jain 22.03.2019 Changes & fixes:
+" Allow chars in 1st 6 columns
+" #C22032019
if exists("b:did_indent")
finish
@@ -66,7 +71,9 @@ function! GetCobolIndent(lnum) abort
let ashft = minshft + 1
let bshft = ashft + 4
" (Obsolete) numbered lines
- if getline(a:lnum) =~? '^\s*\d\{6\}\%($\|[ */$CD-]\)'
+ " #C22032019: Columns 1-6 could have alphabets as well as numbers
+ "if getline(a:lnum) =~? '^\s*\d\{6\}\%($\|[ */$CD-]\)'
+ if getline(a:lnum) =~? '^\s*[a-zA-Z0-9]\{6\}\%($\|[ */$CD-]\)'
return 0
endif
let cline = s:stripped(a:lnum)
diff --git a/runtime/indent/html.vim b/runtime/indent/html.vim
index 1a8177050..1d2043ae9 100644
--- a/runtime/indent/html.vim
+++ b/runtime/indent/html.vim
@@ -2,7 +2,7 @@
" Header: "{{{
" Maintainer: Bram Moolenaar
" Original Author: Andy Wokula <anwoku@yahoo.de>
-" Last Change: 2018 Mar 28
+" Last Change: 2019 Mar 20
" Version: 1.0
" Description: HTML indent script with cached state for faster indenting on a
" range of lines.
@@ -902,12 +902,19 @@ func! s:InsideTag(foundHtmlString)
"{{{
if a:foundHtmlString
" Inside an attribute string.
- " Align with the previous line or use an external function.
+ " Align with the opening quote or use an external function.
let lnum = v:lnum - 1
if lnum > 1
if exists('b:html_indent_tag_string_func')
return b:html_indent_tag_string_func(lnum)
endif
+ " If there is a double quote in the previous line, indent with the
+ " character after it.
+ if getline(lnum) =~ '"'
+ call cursor(lnum, 0)
+ normal f"
+ return virtcol('.')
+ endif
return indent(lnum)
endif
endif
diff --git a/runtime/indent/sh.vim b/runtime/indent/sh.vim
index c93be3195..0396b4eb9 100644
--- a/runtime/indent/sh.vim
+++ b/runtime/indent/sh.vim
@@ -7,6 +7,8 @@
" License: Vim (see :h license)
" Repository: https://github.com/chrisbra/vim-sh-indent
" Changelog:
+" 20190316 - Make use of searchpairpos for nested if sections
+" fixes #11
" 20190201 - Better check for closing if sections
" 20180724 - make check for zsh syntax more rigid (needs word-boundaries)
" 20180326 - better support for line continuation
@@ -115,7 +117,7 @@ function! GetShIndent()
" Current line is a endif line, so get indent from start of "if condition" line
" TODO: should we do the same for other "end" lines?
if curline =~ '^\s*\%(fi\)\s*\%(#.*\)\=$'
- let previous_line = search('if.\{-\};\s*then\s*\%(#.*\)\=$', 'bnW')
+ let previous_line = searchpair('\<if\>', '', '\<fi\>', 'bnW')
if previous_line > 0
let ind = indent(previous_line)
endif
diff --git a/runtime/indent/testdir/README.txt b/runtime/indent/testdir/README.txt
index 28c162856..65975605c 100644
--- a/runtime/indent/testdir/README.txt
+++ b/runtime/indent/testdir/README.txt
@@ -82,9 +82,9 @@ RUNNING THE TEST
Before running the test, create a FILETYPE.ok file. You can leave it empty at
first.
-Now run "make test". After Vim has done the indenting you will see a
-FILETYPE.fail file. This contains the actual result of indenting, and it's
-different from the FILETYPE.ok file.
+Now run "make test" from the parent directory. After Vim has done the
+indenting you will see a FILETYPE.fail file. This contains the actual result
+of indenting, and it's different from the FILETYPE.ok file.
Check the contents of the FILETYPE.fail file. If it is perfectly OK, then
rename it to overwrite the FILETYPE.ok file. If you now run "make test" again,
diff --git a/runtime/indent/testdir/html.ok b/runtime/indent/testdir/html.ok
index 524d57bb6..ad819333c 100644
--- a/runtime/indent/testdir/html.ok
+++ b/runtime/indent/testdir/html.ok
@@ -9,17 +9,17 @@
</div>
<div
- class="foo bar">
+ class="foo bar">
text
</div>
<div class="foo bar"
- data="something">
+ data="something">
text
</div>
<div class="foo
- bar">
+ bar">
text
</div>
diff --git a/runtime/indent/testdir/runtest.vim b/runtime/indent/testdir/runtest.vim
index 2943152d3..0f0051415 100644
--- a/runtime/indent/testdir/runtest.vim
+++ b/runtime/indent/testdir/runtest.vim
@@ -7,6 +7,7 @@ if 1
set nocp
filetype indent on
+syn on
set nowrapscan
set report=9999
@@ -111,7 +112,6 @@ for fname in glob('testdir/*.in', 1, 1)
if failed
exe 'write ' . root . '.fail'
echoerr 'Test ' . fname . ' FAILED!'
- sleep 2
else
exe 'write ' . root . '.out'
endif
diff --git a/runtime/indent/testdir/xml.ok b/runtime/indent/testdir/xml.ok
index 529198572..cfdf701c1 100644
--- a/runtime/indent/testdir/xml.ok
+++ b/runtime/indent/testdir/xml.ok
@@ -10,11 +10,11 @@
<!-- text comment -->
<!--
- text comment
+ text comment
-->
</tag1>
<!--
- text comment
+ text comment
end coment -->
</tag0>
<!-- END_INDENT -->
diff --git a/runtime/indent/xml.vim b/runtime/indent/xml.vim
index 29069bab8..ad22de1d5 100644
--- a/runtime/indent/xml.vim
+++ b/runtime/indent/xml.vim
@@ -1,9 +1,11 @@
" Language: xml
" Repository: https://github.com/chrisbra/vim-xml-ftplugin
-" Last Changed: Jan 28, 2019
+" Last Changed: Feb 04, 2019
" Maintainer: Christian Brabandt <cb@256bit.org>
" Previous Maintainer: Johannes Zellner <johannes@zellner.org>
" Last Change:
+" 20190204 - correctly handle wrap tags
+" https://github.com/chrisbra/vim-xml-ftplugin/issues/5
" 20190128 - Make sure to find previous tag
" https://github.com/chrisbra/vim-xml-ftplugin/issues/4
" 20181116 - Fix indentation when tags start with a colon or an underscore
@@ -74,13 +76,20 @@ fun! <SID>XmlIndentSynCheck(lnum)
endfun
" [-- return the sum of indents of a:lnum --]
-fun! <SID>XmlIndentSum(lnum, style, add)
- let line = getline(a:lnum)
- if a:style == match(line, '^\s*</')
+fun! <SID>XmlIndentSum(line, style, add)
+ if <SID>IsXMLContinuation(a:line) && a:style == 0
+ " no complete tag, add one additional indent level
+ " but only for the current line
+ return a:add + shiftwidth()
+ elseif <SID>HasNoTagEnd(a:line)
+ " no complete tag, return initial indent
+ return a:add
+ endif
+ if a:style == match(a:line, '^\s*</')
return (shiftwidth() *
- \ (<SID>XmlIndentWithPattern(line, b:xml_indent_open)
- \ - <SID>XmlIndentWithPattern(line, b:xml_indent_close)
- \ - <SID>XmlIndentWithPattern(line, '.\{-}/>'))) + a:add
+ \ (<SID>XmlIndentWithPattern(a:line, b:xml_indent_open)
+ \ - <SID>XmlIndentWithPattern(a:line, b:xml_indent_close)
+ \ - <SID>XmlIndentWithPattern(a:line, '.\{-}/>'))) + a:add
else
return a:add
endif
@@ -89,19 +98,24 @@ endfun
" Main indent function
fun! XmlIndentGet(lnum, use_syntax_check)
" Find a non-empty line above the current line.
- let plnum = prevnonblank(a:lnum - 1)
- " Hit the start of the file, use zero indent.
- if plnum == 0
+ if prevnonblank(a:lnum - 1) == 0
+ " Hit the start of the file, use zero indent.
return 0
endif
" Find previous line with a tag (regardless whether open or closed,
" but always start restrict the match to a line before the current one
+ " Note: xml declaration: <?xml version="1.0"?>
+ " won't be found, as it is not a legal tag name
let ptag_pattern = '\%(.\{-}<[/:A-Z_a-z]\)'. '\%(\&\%<'. line('.').'l\)'
- let ptag = search(ptag_pattern, 'bnw')
+ let ptag = search(ptag_pattern, 'bnW')
+ " no previous tag
+ if ptag == 0
+ return 0
+ endif
let syn_name = ''
if a:use_syntax_check
- let check_lnum = <SID>XmlIndentSynCheck(plnum)
+ let check_lnum = <SID>XmlIndentSynCheck(ptag)
let check_alnum = <SID>XmlIndentSynCheck(a:lnum)
if check_lnum == 0 || check_alnum == 0
return indent(a:lnum)
@@ -113,18 +127,31 @@ fun! XmlIndentGet(lnum, use_syntax_check)
return <SID>XmlIndentComment(a:lnum)
endif
+ let pline = getline(ptag)
+ let pind = indent(ptag)
" Get indent from previous tag line
- let ind = <SID>XmlIndentSum(ptag, -1, indent(ptag))
+ let ind = <SID>XmlIndentSum(pline, -1, pind)
+ let t_ind = ind
" Determine indent from current line
- let ind = <SID>XmlIndentSum(a:lnum, 0, ind)
+ let ind = <SID>XmlIndentSum(getline(a:lnum), 0, ind)
return ind
endfun
+func! <SID>IsXMLContinuation(line)
+ " Checks, whether or not the line matches a start-of-tag
+ return a:line !~ '^\s*<'
+endfunc
+
+func! <SID>HasNoTagEnd(line)
+ " Checks whether or not the line matches '>' (so finishes a tag)
+ return a:line !~ '>\s*$'
+endfunc
+
" return indent for a commented line,
" the middle part might be indented on additional level
func! <SID>XmlIndentComment(lnum)
- let ptagopen = search(b:xml_indent_open, 'bnw')
- let ptagclose = search(b:xml_indent_close, 'bnw')
+ let ptagopen = search(b:xml_indent_open, 'bnW')
+ let ptagclose = search(b:xml_indent_close, 'bnW')
if getline(a:lnum) =~ '<!--'
" if previous tag was a closing tag, do not add
" one additional level of indent
@@ -136,10 +163,10 @@ func! <SID>XmlIndentComment(lnum)
endif
elseif getline(a:lnum) =~ '-->'
" end of comment, same as start of comment
- return indent(search('<!--', 'bnw'))
+ return indent(search('<!--', 'bnW'))
else
" middle part of comment, add one additional level
- return indent(search('<!--', 'bnw')) + shiftwidth()
+ return indent(search('<!--', 'bnW')) + shiftwidth()
endif
endfunc
diff --git a/runtime/syntax/cobol.vim b/runtime/syntax/cobol.vim
index 2d481bba0..5d649441a 100644
--- a/runtime/syntax/cobol.vim
+++ b/runtime/syntax/cobol.vim
@@ -1,10 +1,23 @@
" Vim syntax file
" Language: COBOL
-" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
+" Maintainer: Ankit Jain <ajatkj@yahoo.co.in>
+" (formerly Tim Pope <vimNOSPAM@tpope.info>)
" (formerly Davyd Ondrejko <vondraco@columbus.rr.com>)
" (formerly Sitaram Chamarty <sitaram@diac.com> and
" James Mitchell <james_mitchell@acm.org>)
-" Last Change: 2015 Feb 13
+" Last Change: 2019 Mar 22
+" Ankit Jain 22.03.2019 Changes & fixes:
+" 1. Include inline comments
+" 2. Use comment highlight for bad lines
+" 3. Change certain 'keywords' to 'matches'
+" for additional highlighting
+" 4. Different highlighting for COPY, GO TO &
+" CALL lines
+" 5. Fix for COMP keyword
+" 6. Fix for PROCEDURE DIVISION highlighting
+" 7. Highlight EXIT PROGRAM like STOP RUN
+" 8. Highlight X & A in PIC clause
+" Tag: #C22032019
" quit when a syntax file was already loaded
if exists("b:current_syntax")
@@ -12,7 +25,11 @@ if exists("b:current_syntax")
endif
" MOST important - else most of the keywords wont work!
-setlocal isk=@,48-57,-
+setlocal isk=@,48-57,-,_
+
+if !exists('g:cobol_inline_comment')
+ let g:cobol_inline_comment=0
+endif
syn case ignore
@@ -29,7 +46,10 @@ syn match cobolComment "[/*C].*$" contained
syn match cobolCompiler "$.*$" contained
syn match cobolLine ".*$" contained contains=cobolReserved,@cobolLine
-syn match cobolDivision "[A-Z][A-Z0-9-]*[A-Z0-9]\s\+DIVISION\."he=e-1 contained contains=cobolDivisionName
+"#C22032019: Fix for PROCEDURE DIVISION USING highlighting, removed . from the
+"end of the regex
+"syn match cobolDivision \"[A-Z][A-Z0-9-]*[A-Z0-9]\s\+DIVISION\."he=e-1 contained contains=cobolDivisionName
+syn match cobolDivision "[A-Z][A-Z0-9-]*[A-Z0-9]\s\+DIVISION" contained contains=cobolDivisionName
syn keyword cobolDivisionName contained IDENTIFICATION ENVIRONMENT DATA PROCEDURE
syn match cobolSection "[A-Z][A-Z0-9-]*[A-Z0-9]\s\+SECTION\."he=e-1 contained contains=cobolSectionName
syn keyword cobolSectionName contained CONFIGURATION INPUT-OUTPUT FILE WORKING-STORAGE LOCAL-STORAGE LINKAGE
@@ -38,10 +58,12 @@ syn keyword cobolParagraphName contained PROGRAM-ID SOURCE-COMPUTER OBJECT-COMP
"syn match cobolKeys "^\a\{1,6\}" contains=cobolReserved
+"#C22032019: Remove BY, REPLACING, PROGRAM, TO, IN from 'keyword' group and add
+"to 'match' group or other 'keyword' group
syn keyword cobolReserved contained ACCEPT ACCESS ADD ADDRESS ADVANCING AFTER ALPHABET ALPHABETIC
syn keyword cobolReserved contained ALPHABETIC-LOWER ALPHABETIC-UPPER ALPHANUMERIC ALPHANUMERIC-EDITED ALS
syn keyword cobolReserved contained ALTERNATE AND ANY ARE AREA AREAS ASCENDING ASSIGN AT AUTHOR BEFORE BINARY
-syn keyword cobolReserved contained BLANK BLOCK BOTTOM BY CANCEL CBLL CD CF CH CHARACTER CHARACTERS CLASS
+syn keyword cobolReserved contained BLANK BLOCK BOTTOM CANCEL CBLL CD CF CH CHARACTER CHARACTERS CLASS
syn keyword cobolReserved contained CLOCK-UNITS CLOSE COBOL CODE CODE-SET COLLATING COLUMN COMMA COMMON
syn keyword cobolReserved contained COMMUNICATIONS COMPUTATIONAL COMPUTE CONTENT CONTINUE
syn keyword cobolReserved contained CONTROL CONVERTING CORR CORRESPONDING COUNT CURRENCY DATE DATE-COMPILED
@@ -55,52 +77,79 @@ syn keyword cobolReserved contained END-REWRITE END-SEARCH END-START END-STRING
syn keyword cobolReserved contained END-WRITE EQUAL ERROR ESI EVALUATE EVERY EXCEPTION EXIT
syn keyword cobolReserved contained EXTEND EXTERNAL FALSE FD FILLER FINAL FIRST FOOTING FOR FROM
syn keyword cobolReserved contained GENERATE GIVING GLOBAL GREATER GROUP HEADING HIGH-VALUE HIGH-VALUES I-O
-syn keyword cobolReserved contained IN INDEX INDEXED INDICATE INITIAL INITIALIZE
+syn keyword cobolReserved contained INDEX INDEXED INDICATE INITIAL INITIALIZE
syn keyword cobolReserved contained INITIATE INPUT INSPECT INSTALLATION INTO IS JUST
syn keyword cobolReserved contained JUSTIFIED KEY LABEL LAST LEADING LEFT LENGTH LOCK MEMORY
syn keyword cobolReserved contained MERGE MESSAGE MODE MODULES MOVE MULTIPLE MULTIPLY NATIVE NEGATIVE NEXT NO NOT
syn keyword cobolReserved contained NUMBER NUMERIC NUMERIC-EDITED OCCURS OF OFF OMITTED ON OPEN
syn keyword cobolReserved contained OPTIONAL OR ORDER ORGANIZATION OTHER OUTPUT OVERFLOW PACKED-DECIMAL PADDING
syn keyword cobolReserved contained PAGE PAGE-COUNTER PERFORM PF PH PIC PICTURE PLUS POINTER POSITION POSITIVE
-syn keyword cobolReserved contained PRINTING PROCEDURES PROCEDD PROGRAM PURGE QUEUE QUOTES
+syn keyword cobolReserved contained PRINTING PROCEDURES PROCEDD PURGE QUEUE QUOTES
syn keyword cobolReserved contained RANDOM RD READ RECEIVE RECORD RECORDS REDEFINES REEL REFERENCE REFERENCES
-syn keyword cobolReserved contained RELATIVE RELEASE REMAINDER REMOVAL REPLACE REPLACING REPORT REPORTING
+syn keyword cobolReserved contained RELATIVE RELEASE REMAINDER REMOVAL REPLACE REPORT REPORTING
syn keyword cobolReserved contained REPORTS RERUN RESERVE RESET RETURN RETURNING REVERSED REWIND REWRITE RF RH
syn keyword cobolReserved contained RIGHT ROUNDED RUN SAME SD SEARCH SECTION SECURITY SEGMENT SEGMENT-LIMITED
syn keyword cobolReserved contained SELECT SEND SENTENCE SEPARATE SEQUENCE SEQUENTIAL SET SIGN SIZE SORT
syn keyword cobolReserved contained SORT-MERGE SOURCE STANDARD
syn keyword cobolReserved contained STANDARD-1 STANDARD-2 START STATUS STOP STRING SUB-QUEUE-1 SUB-QUEUE-2
syn keyword cobolReserved contained SUB-QUEUE-3 SUBTRACT SUM SUPPRESS SYMBOLIC SYNC SYNCHRONIZED TABLE TALLYING
-syn keyword cobolReserved contained TAPE TERMINAL TERMINATE TEST TEXT THAN THEN THROUGH THRU TIME TIMES TO TOP
+syn keyword cobolReserved contained TAPE TERMINAL TERMINATE TEST TEXT THAN THEN THROUGH THRU TIME TIMES TOP
syn keyword cobolReserved contained TRAILING TRUE TYPE UNIT UNSTRING UNTIL UP UPON USAGE USE USING VALUE VALUES
syn keyword cobolReserved contained VARYING WHEN WITH WORDS WRITE
syn match cobolReserved contained "\<CONTAINS\>"
syn match cobolReserved contained "\<\(IF\|INVALID\|END\|EOP\)\>"
syn match cobolReserved contained "\<ALL\>"
+" #C22032019: Add BY as match instead of keyword: BY not followed by ==
+syn match cobolReserved contained "\<BY\>\s\+\(==\)\@!"
+syn match cobolReserved contained "\<TO\>"
syn cluster cobolLine add=cobolConstant,cobolNumber,cobolPic
syn keyword cobolConstant SPACE SPACES NULL ZERO ZEROES ZEROS LOW-VALUE LOW-VALUES
+" #C22032019: Fix for many pic clauses
syn match cobolNumber "\<-\=\d*\.\=\d\+\>" contained
-syn match cobolPic "\<S*9\+\>" contained
+" syn match cobolPic \"\<S*9\+\>" contained
+syn match cobolPic "\<S*9\+V*9*\>" contained
syn match cobolPic "\<$*\.\=9\+\>" contained
syn match cobolPic "\<Z*\.\=9\+\>" contained
syn match cobolPic "\<V9\+\>" contained
syn match cobolPic "\<9\+V\>" contained
-syn match cobolPic "\<-\+[Z9]\+\>" contained
-syn match cobolTodo "todo" contained containedin=cobolComment
+" syn match cobolPic \"\<-\+[Z9]\+\>" contained
+syn match cobolPic "\<-*[Z9]\+-*\>" contained
+" #C22032019: Add Z,X and A to cobolPic
+syn match cobolPic "\<[ZXA]\+\>" contained
+syn match cobolTodo "todo" contained containedin=cobolInlineComment,cobolComment
" For MicroFocus or other inline comments, include this line.
-" syn region cobolComment start="*>" end="$" contains=cobolTodo,cobolMarker
+if g:cobol_inline_comment == 1
+ syn region cobolInlineComment start="*>" end="$" contains=cobolTodo,cobolMarker
+ syn cluster cobolLine add=cobolInlineComment
+endif
syn match cobolBadLine "[^ D\*$/-].*" contained
+
" If comment mark somehow gets into column past Column 7.
-syn match cobolBadLine "\s\+\*.*" contained
+if g:cobol_inline_comment == 1
+ " #C22032019: It is a bad line only if * is not followed by > when inline
+ " comments enabled
+ syn match cobolBadLine "\s\+\*\(>\)\@!.*" contained
+else
+ syn match cobolBadLine "\s\+\*.*" contained
+endif
syn cluster cobolStart add=cobolBadLine
-
-syn keyword cobolGoTo GO GOTO
-syn keyword cobolCopy COPY
+" #C22032019: Different highlighting for GO TO statements
+" syn keyword cobolGoTo GO GOTO
+syn keyword cobolGoTo GOTO
+syn match cobolGoTo /\<GO\>\s\+\<TO\>/
+syn match cobolGoToPara /\<GO\>\s\+\<TO\>\s\+[A-Z0-9-]\+/ contains=cobolGoTo
+" #C22032019: Highlight copybook name and location in using different group
+" syn keyword cobolCopy COPY
+syn match cobolCopy "\<COPY\>\|\<IN\>"
+syn match cobolCopy "\<REPLACING\>\s\+\(==\)\@="
+syn match cobolCopy "\<BY\>\s\+\(==\)\@="
+syn match cobolCopyName "\<COPY\>\s\+[A-Z0-9]\+\(\s\+\<IN\>\s\+[A-Z0-9]\+\)\?" contains=cobolCopy
+syn cluster cobolLine add=cobolGoToPara,cobolCopyName
" cobolBAD: things that are BAD NEWS!
syn keyword cobolBAD ALTER ENTER RENAMES
@@ -109,8 +158,14 @@ syn cluster cobolLine add=cobolGoTo,cobolCopy,cobolBAD,cobolWatch,cobolEXE
" cobolWatch: things that are important when trying to understand a program
syn keyword cobolWatch OCCURS DEPENDING VARYING BINARY COMP REDEFINES
-syn keyword cobolWatch REPLACING RUN
-syn match cobolWatch "COMP-[123456XN]"
+" #C22032019: Remove REPLACING from cobolWatch 'keyword' group and add to cobolCopy &
+" cobolWatch 'match' group
+" syn keyword cobolWatch REPLACING RUN
+syn keyword cobolWatch RUN PROGRAM
+syn match cobolWatch contained "\<REPLACING\>\s\+\(==\)\@!"
+" #C22032019: Look for word starting with COMP
+" syn match cobolWatch \"COMP-[123456XN]"
+syn match cobolWatch "\<COMP-[123456XN]"
syn keyword cobolEXECs EXEC END-EXEC
@@ -127,9 +182,15 @@ syn match cobolWatch "88 " contained nextgroup=cobolLine
"syn match cobolBadID "\k\+-\($\|[^-A-Z0-9]\)" contained
syn cluster cobolLine add=cobolCALLs,cobolString,cobolCondFlow
-syn keyword cobolCALLs CALL END-CALL CANCEL GOBACK PERFORM END-PERFORM INVOKE
-syn match cobolCALLs "EXIT \+PROGRAM"
+" #C22032019: Changes for cobolCALLs group to include thru
+" syn keyword cobolCALLs CALL END-CALL CANCEL GOBACK PERFORM END-PERFORM INVOKE
+syn keyword cobolCALLs END-CALL CANCEL GOBACK PERFORM END-PERFORM INVOKE THRU
+" #C22032019: Highlight called program
+" syn match cobolCALLs \"EXIT \+PROGRAM"
+syn match cobolCALLs "\<CALL\>"
+syn match cobolCALLProg /\<CALL\>\s\+"\{0,1\}[A-Z0-9]\+"\{0,1\}/ contains=cobolCALLs
syn match cobolExtras /\<VALUE \+\d\+\./hs=s+6,he=e-1
+syn cluster cobolLine add=cobolCALLProg
syn match cobolString /"[^"]*\("\|$\)/
syn match cobolString /'[^']*\('\|$\)/
@@ -138,7 +199,7 @@ syn match cobolString /'[^']*\('\|$\)/
syn match cobolIndicator "\%7c[D-]" contained
if exists("cobol_legacy_code")
- syn region cobolCondFlow contains=ALLBUT,cobolLine,cobolBadLine start="\<\(IF\|INVALID\|END\|EOP\)\>" skip=/\('\|"\)[^"]\{-}\("\|'\|$\)/ end="\." keepend
+ syn region cobolCondFlow contains=ALLBUT,cobolLine start="\<\(IF\|INVALID\|END\|EOP\)\>" skip=/\('\|"\)[^"]\{-}\("\|'\|$\)/ end="\." keepend
endif
" many legacy sources have junk in columns 1-6: must be before others
@@ -146,7 +207,9 @@ endif
if exists("cobol_legacy_code")
syn match cobolBadLine "\%73c.*" containedin=ALLBUT,cobolComment
else
- syn match cobolBadLine "\%73c.*" containedin=ALL
+ " #C22032019: Use comment highlighting for bad lines
+ " syn match cobolBadLine \"\%73c.*" containedin=ALL
+ syn match cobolBadLine "\%73c.*" containedin=ALL,cobolInlineComment,cobolComment
endif
" Define the default highlighting.
@@ -160,31 +223,36 @@ if exists("g:cobol_legacy_code")
else
hi def link cobolMarker Error
endif
-hi def link cobolCALLs Function
-hi def link cobolComment Comment
-hi def link cobolKeys Comment
-hi def link cobolAreaB Special
-hi def link cobolCompiler PreProc
-hi def link cobolCondFlow Special
-hi def link cobolCopy PreProc
-hi def link cobolDeclA cobolDecl
-hi def link cobolDecl Type
-hi def link cobolExtras Special
-hi def link cobolGoTo Special
-hi def link cobolConstant Constant
-hi def link cobolNumber Constant
-hi def link cobolPic Constant
-hi def link cobolReserved Statement
-hi def link cobolDivision Label
-hi def link cobolSection Label
-hi def link cobolParagraph Label
-hi def link cobolDivisionName Keyword
-hi def link cobolSectionName Keyword
-hi def link cobolParagraphName Keyword
-hi def link cobolString Constant
-hi def link cobolTodo Todo
-hi def link cobolWatch Special
-hi def link cobolIndicator Special
+hi def link cobolCALLs Function
+hi def link cobolCALLProg Special
+hi def link cobolComment Comment
+hi def link cobolInlineComment Comment
+hi def link cobolKeys Comment
+hi def link cobolAreaB Special
+hi def link cobolCompiler PreProc
+hi def link cobolCondFlow Special
+hi def link cobolCopy PreProc
+hi def link cobolCopyName Special
+hi def link cobolDeclA cobolDecl
+hi def link cobolDecl Type
+hi def link cobolExtras Special
+hi def link cobolGoTo Special
+hi def link cobolGoToPara Function
+hi def link cobolConstant Constant
+hi def link cobolNumber Constant
+hi def link cobolPic Constant
+hi def link cobolReserved Statement
+hi def link cobolDivision Label
+hi def link cobolSection Label
+hi def link cobolParagraph Label
+hi def link cobolDivisionName Keyword
+hi def link cobolSectionName Keyword
+hi def link cobolParagraphName Keyword
+hi def link cobolString Constant
+hi def link cobolTodo Todo
+hi def link cobolWatch Special
+hi def link cobolIndicator Special
+hi def link cobolStart Comment
let b:current_syntax = "cobol"