summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--runtime/doc/change.txt6
-rw-r--r--runtime/doc/channel.txt84
-rw-r--r--runtime/doc/eval.txt5
-rw-r--r--runtime/doc/options.txt16
-rw-r--r--runtime/doc/tags12
-rw-r--r--runtime/doc/todo.txt42
-rw-r--r--runtime/ftplugin/r.vim3
-rw-r--r--runtime/ftplugin/rhelp.vim3
-rw-r--r--runtime/ftplugin/rmd.vim3
-rw-r--r--runtime/ftplugin/rnoweb.vim3
-rw-r--r--runtime/ftplugin/rrst.vim3
-rw-r--r--runtime/indent/r.vim24
-rw-r--r--runtime/indent/rhelp.vim3
-rw-r--r--runtime/indent/rmd.vim3
-rw-r--r--runtime/indent/rnoweb.vim3
-rw-r--r--runtime/indent/rrst.vim3
-rw-r--r--runtime/syntax/python.vim4
-rw-r--r--runtime/syntax/r.vim62
-rw-r--r--runtime/syntax/rhelp.vim246
-rw-r--r--runtime/syntax/rmd.vim10
-rw-r--r--runtime/syntax/rnoweb.vim33
-rw-r--r--runtime/syntax/rrst.vim8
-rw-r--r--runtime/syntax/vhdl.vim56
23 files changed, 352 insertions, 283 deletions
diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt
index 3f2f490df2..2280f65063 100644
--- a/runtime/doc/change.txt
+++ b/runtime/doc/change.txt
@@ -1,4 +1,4 @@
-*change.txt* For Vim version 7.4. Last change: 2016 Feb 10
+*change.txt* For Vim version 7.4. Last change: 2016 Mar 08
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -109,7 +109,9 @@ is an error when 'cpoptions' includes the 'E' flag.
*J*
J Join [count] lines, with a minimum of two lines.
Remove the indent and insert up to two spaces (see
- below).
+ below). Fails when on the last line of the buffer.
+ If [count] is too big it is reduce to the number of
+ lines available.
*v_J*
{Visual}J Join the highlighted lines, with a minimum of two
diff --git a/runtime/doc/channel.txt b/runtime/doc/channel.txt
index a89bdb7875..36a7c9b688 100644
--- a/runtime/doc/channel.txt
+++ b/runtime/doc/channel.txt
@@ -1,4 +1,4 @@
-*channel.txt* For Vim version 7.4. Last change: 2016 Mar 06
+*channel.txt* For Vim version 7.4. Last change: 2016 Mar 12
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -44,8 +44,8 @@ There are four main types of jobs:
4. Running a filter, synchronously.
Uses pipes.
-For when using sockets See |job-start|, |job-may-start| and |channel-open|.
-For 2 and 3, one or more jobs using pipes, see |job-start|.
+For when using sockets See |job-start|, |job-start-nochannel| and
+|channel-open|. For 2 and 3, one or more jobs using pipes, see |job-start|.
For 4 use the ":{range}!cmd" command, see |filter|.
Over the socket and pipes these protocols are available:
@@ -162,7 +162,7 @@ Use |ch_status()| to see if the channel could be opened.
the channel uses pipes. When "err-cb" wasn't set the channel
callback is used.
- TODO: *close-cb*
+ *close-cb*
"close-cb" A function that is called when the channel gets closed, other
than by calling ch_close(). It should be defined like this: >
func MyCloseHandler(channel)
@@ -410,7 +410,6 @@ are:
"open" The channel can be used.
"closed" The channel was closed.
-TODO:
To obtain the job associated with a channel: ch_getjob(channel)
To read one message from a channel: >
@@ -486,15 +485,6 @@ time a line is added to the buffer, the last-but-one line will be send to the
job stdin. This allows for editing the last line and sending it when pressing
Enter.
-TODO:
-To run a job and read its output once it is done: >
- let job = job_start({command}, {'exit-cb': 'MyHandler'})
- func MyHandler(job, status)
- let channel = job_getchannel()
- let output = ch_readall(channel)
- " parse output
- endfunc
-
==============================================================================
9. Starting a job without a channel *job-start-nochannel*
@@ -504,28 +494,23 @@ To start another process without creating a channel: >
This starts {command} in the background, Vim does not wait for it to finish.
-TODO:
When Vim sees that neither stdin, stdout or stderr are connected, no channel
will be created. Often you will want to include redirection in the command to
avoid it getting stuck.
There are several options you can use, see |job-options|.
-TODO: *job-may-start*
-To start a job only when connecting to an address does not work use
-job_maystart('command', {address}, {options}), For Example: >
- let job = job_maystart(command, address, {"waittime": 1000})
- let channel = job_gethandle(job)
-
-This comes down to: >
+ *job-start-if-needed*
+To start a job only when connecting to an address does not work, do something
+like this: >
let channel = ch_open(address, {"waittime": 0})
if ch_status(channel) == "fail"
let job = job_start(command)
let channel = ch_open(address, {"waittime": 1000})
- call job_sethandle(channel)
endif
-Note that the specified waittime applies to when the job has been started.
-This gives the job some time to make the port available.
+
+Note that the waittime for ch_open() gives the job one second to make the port
+available.
==============================================================================
10. Job options *job-options*
@@ -560,43 +545,54 @@ See |job_setoptions()| and |ch_setoptions()|.
"stoponexit": "" Do not stop the job when Vim exits.
The default is "term".
-TODO: *job-term*
+ *job-term*
"term": "open" Start a terminal and connect the job
stdin/stdout/stderr to it.
+ NOTE: Not implemented yet!
+
+"channel": {channel} Use an existing channel instead of creating a new one.
+ The parts of the channel that get used for the new job
+ will be disconnected from what they were used before.
+ If the channel was still use by another job this may
+ cause I/O errors.
+ Existing callbacks and other settings remain.
- *job-in-io*
-"in-io": "null" disconnect stdin TODO
+ *job-in-io* *in-top* *in-bot* *in-name* *in-buf*
+"in-io": "null" disconnect stdin (read from /dev/null)
"in-io": "pipe" stdin is connected to the channel (default)
-"in-io": "file" stdin reads from a file TODO
+"in-io": "file" stdin reads from a file
"in-io": "buffer" stdin reads from a buffer
"in-top": number when using "buffer": first line to send (default: 1)
"in-bot": number when using "buffer": last line to send (default: last)
"in-name": "/path/file" the name of the file or buffer to read from
-"in-buf": number the number of the buffer to read from TODO
+"in-buf": number the number of the buffer to read from
- *job-out-io*
-"out-io": "null" disconnect stdout TODO
+ *job-out-io* *out-name* *out-buf*
+"out-io": "null" disconnect stdout (goes to /dev/null)
"out-io": "pipe" stdout is connected to the channel (default)
-"out-io": "file" stdout writes to a file TODO
+"out-io": "file" stdout writes to a file
"out-io": "buffer" stdout appends to a buffer
"out-name": "/path/file" the name of the file or buffer to write to
-"out-buf": number the number of the buffer to write to TODO
+"out-buf": number the number of the buffer to write to
- *job-err-io*
+ *job-err-io* *err-name* *err-buf*
"err-io": "out" stderr messages to go to stdout
-"err-io": "null" disconnect stderr TODO
+"err-io": "null" disconnect stderr (goes to /dev/null)
"err-io": "pipe" stderr is connected to the channel (default)
-"err-io": "file" stderr writes to a file TODO
-"err-io": "buffer" stderr appends to a buffer TODO
+"err-io": "file" stderr writes to a file
+"err-io": "buffer" stderr appends to a buffer
"err-name": "/path/file" the name of the file or buffer to write to
-"err-buf": number the number of the buffer to write to TODO
+"err-buf": number the number of the buffer to write to
+
+
+Writing to a buffer ~
When the out-io or err-io mode is "buffer" and there is a callback, the text
is appended to the buffer before invoking the callback.
When a buffer is used both for input and output, the output lines are put
above the last line, since the last line is what is written to the channel
-input. Otherwise lines are appened below the last line.
+input. Otherwise lines are appended below the last line.
When using JS or JSON mode with "buffer", only messages with zero or negative
ID will be added to the buffer, after decoding + encoding. Messages with a
@@ -616,6 +612,14 @@ line and the window is scrolled up to show the cursor if needed.
Undo is synced for every added line.
+
+Writing to a file ~
+
+The file is created with permissions 600 (read-write for the user, not
+accessible for others). Use |setfperm()| to change this.
+
+If the file already exists it is truncated.
+
==============================================================================
11. Controlling a job *job-control*
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 8910f2ff4c..5284293d46 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,4 +1,4 @@
-*eval.txt* For Vim version 7.4. Last change: 2016 Mar 07
+*eval.txt* For Vim version 7.4. Last change: 2016 Mar 08
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -4468,6 +4468,9 @@ items({dict}) *items()*
job_getchannel({job}) *job_getchannel()*
Get the channel handle that {job} is using.
+ To check if the job has no channel: >
+ if string(job_getchannel()) == 'channel fail'
+<
{only available when compiled with the |+job| feature}
job_setoptions({job}, {options}) *job_setoptions()*
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 09518c0578..0396011e7b 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,4 +1,4 @@
-*options.txt* For Vim version 7.4. Last change: 2016 Feb 24
+*options.txt* For Vim version 7.4. Last change: 2016 Mar 08
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -7769,13 +7769,15 @@ A jump table for the options with a short description can be found at |Q_op|.
{not in Vi}
{only in the GTK+ 2 GUI}
Controls the size of toolbar icons. The possible values are:
- tiny Use tiny toolbar icons.
- small Use small toolbar icons (default).
- medium Use medium-sized toolbar icons.
- large Use large toolbar icons.
+ tiny Use tiny icons.
+ small Use small icons (default).
+ medium Use medium-sized icons.
+ large Use large icons.
+ huge Use even larger icons.
+ giant Use very big icons.
The exact dimensions in pixels of the various icon sizes depend on
- the current theme. Common dimensions are large=32x32, medium=24x24,
- small=20x20 and tiny=16x16.
+ the current theme. Common dimensions are giant=48x48, huge=32x32,
+ large=24x24, medium=24x24, small=20x20 and tiny=16x16.
If 'toolbariconsize' is empty, the global default size as determined
by user preferences or the current theme is used.
diff --git a/runtime/doc/tags b/runtime/doc/tags
index 7deba0ca7c..1c644ca717 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -5226,6 +5226,7 @@ charity uganda.txt /*charity*
charset mbyte.txt /*charset*
charset-conversion mbyte.txt /*charset-conversion*
chill.vim syntax.txt /*chill.vim*
+chmod eval.txt /*chmod*
cindent() eval.txt /*cindent()*
cinkeys-format indent.txt /*cinkeys-format*
cino-# indent.txt /*cino-#*
@@ -5642,7 +5643,9 @@ end intro.txt /*end*
end-of-file pattern.txt /*end-of-file*
enlightened-terminal syntax.txt /*enlightened-terminal*
erlang.vim syntax.txt /*erlang.vim*
+err-buf channel.txt /*err-buf*
err-cb channel.txt /*err-cb*
+err-name channel.txt /*err-name*
err-timeout channel.txt /*err-timeout*
errmsg-variable eval.txt /*errmsg-variable*
error-file-format quickfix.txt /*error-file-format*
@@ -6762,6 +6765,10 @@ improved-viminfo version5.txt /*improved-viminfo*
improvements-5 version5.txt /*improvements-5*
improvements-6 version6.txt /*improvements-6*
improvements-7 version7.txt /*improvements-7*
+in-bot channel.txt /*in-bot*
+in-buf channel.txt /*in-buf*
+in-name channel.txt /*in-name*
+in-top channel.txt /*in-top*
inactive-buffer windows.txt /*inactive-buffer*
include-search tagsrch.txt /*include-search*
inclusive motion.txt /*inclusive*
@@ -6845,11 +6852,11 @@ job-err-cb channel.txt /*job-err-cb*
job-err-io channel.txt /*job-err-io*
job-exit-cb channel.txt /*job-exit-cb*
job-in-io channel.txt /*job-in-io*
-job-may-start channel.txt /*job-may-start*
job-options channel.txt /*job-options*
job-out-cb channel.txt /*job-out-cb*
job-out-io channel.txt /*job-out-io*
job-start channel.txt /*job-start*
+job-start-if-needed channel.txt /*job-start-if-needed*
job-start-nochannel channel.txt /*job-start-nochannel*
job-stoponexit channel.txt /*job-stoponexit*
job-term channel.txt /*job-term*
@@ -7572,7 +7579,9 @@ os_unix.txt os_unix.txt /*os_unix.txt*
os_vms.txt os_vms.txt /*os_vms.txt*
os_win32.txt os_win32.txt /*os_win32.txt*
other-features vi_diff.txt /*other-features*
+out-buf channel.txt /*out-buf*
out-cb channel.txt /*out-cb*
+out-name channel.txt /*out-name*
out-timeout channel.txt /*out-timeout*
p change.txt /*p*
pack-add repeat.txt /*pack-add*
@@ -7979,6 +7988,7 @@ set-spc-auto spell.txt /*set-spc-auto*
setbufvar() eval.txt /*setbufvar()*
setcharsearch() eval.txt /*setcharsearch()*
setcmdpos() eval.txt /*setcmdpos()*
+setfperm() eval.txt /*setfperm()*
setline() eval.txt /*setline()*
setloclist() eval.txt /*setloclist()*
setmatches() eval.txt /*setmatches()*
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index c6c38e14c0..afa8219135 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt* For Vim version 7.4. Last change: 2016 Mar 07
+*todo.txt* For Vim version 7.4. Last change: 2016 Mar 11
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -35,16 +35,11 @@ not be repeated below, unless there is extra information.
-------------------- Known bugs and current work -----------------------
+channel:
+- CHANNEL_PIPES -> FEAT_JOB
+- FEAT_JOB / FEAT_CHANNEL -> FEAT_JOBCHANNEL ?
- move code from eval.c to channel.c
-- implement TODO items in ":help channel":
- - job_start() options:
- in-io: null, in-buf
- out-io: null, file, out-buf
- err-io: null, file (err-name), buffer (err-buf)
- existing channel to use
- - job_maystart()
- - add job_info(): process ID, run/dead, etc.
- - add ch_info(): in/out/err mode, timeout, callbacks, etc.
+- add job_info(): process ID, run/dead, etc.
+- add ch_info(): in/out/err mode, timeout, callbacks, etc.
- Move more details from eval.txt to channel.txt. Add tags in eval.txt.
- When receiving malformed json starting with a quote it doesn't get
discarded. Any invalid JSON or JSON that isn't a list will block further
@@ -53,16 +48,16 @@ not be repeated below, unless there is extra information.
properly.
- When a message in the queue but there is no callback, drop it after a while?
Add timestamp to queued messages and callbacks with ID, remove after a
- minute.
-- Add more log calls, basically at every branch, before every callback, etc.
-- add remark about undo sync, is there a way to force it?
+ minute. Option to set the droptime.
+- Add more ch_log calls, basically at every branch, before every callback, etc.
+- Add remark about undo sync, is there a way to force it?
- When starting a job, have an option to open the server socket, so we know
the port, and pass it to the command with --socket-fd {nr}. (Olaf Dabrunz,
Feb 9) How to do this on MS-Windows?
- Add more unit-testing in json_test.c
- Add a test where ["eval","getline(123)"] gets a line with special
characters (NUL, 0x80, etc.). Check that it isn't garbled.
-- make sure errors lead to a useful error msg. ["ex","foobar"]
+- Make sure errors lead to a useful error msg. ["ex","foobar"]
- For connection to server, a "keep open" flag would be useful. Retry
connecting in the main loop with zero timeout.
Later
@@ -71,13 +66,16 @@ Later
emoji patch from Yasuhiro Matsumoto. Asked Thomas Dickey.
+Remove sticky type checking.
+
Packages:
- Add command to update help tags in 'runtimepath'. Pathogen has something
like that.
- colorscheme command in .vimrc doesn't work.
- - Postpone until later?
- - Also search in 'packpath'?
- - command to load packages now?
+ - Also search in 'packpath', both "start" and "opt", don't add dir to 'rtp'
+- command like :runtime that also search 'packpath'. :packruntime
+ use "ever" or "opt"? both?
+- command to load packages now?
More plugin support:
- Have a way to install a callback from the main loop. Called every second or
@@ -198,9 +196,13 @@ Two patches now? New update Feb 24.
Patch to support 64 bit ints for Number. (Ken Takata, 2016 Jan 21)
Also in update of Feb 24?
+After 7.5 is released:
+- Drop support for older MS-Windows systems, before XP.
+ Patch from Ken Takata, 2016 Mar 8.
+
Patch to add setbufline(). (email from Yasuhiro Matsumoto, patch by Ozaki
Kiichi, 2016 Feb 28)
-https://gist.github.com/ichizok/64bdc92aed19ec9001dd
+Update Mar 8: https://gist.github.com/mattn/23c1f50999084992ca98
Need to try out instructions in INSSTALLpc.txt about how to install all
interfaces and how to build Vim with them.
@@ -225,8 +227,6 @@ What if there is an invalid character?
Should jsonencode()/jsondecode() restrict recursiveness?
Or avoid recursiveness.
-Patch to fix bug in statusline highlighting. (Christian Brabandt, 2016 Feb 2)
-
Use vim.vim syntax highlighting for help file examples, but without ":" in
'iskeyword' for syntax.
@@ -306,7 +306,7 @@ set_color_count().
Python: ":py raw_input('prompt')" doesn't work. (Manu Hack)
-Comparing nested structures with "==" uses a different comperator than when
+Comparing nested structures with "==" uses a different comparator than when
comparing individual items.
Also, "'' == 0" evaluates to true, which isn't nice.
Add "===" to have a strict comparison (type and value match).
diff --git a/runtime/ftplugin/r.vim b/runtime/ftplugin/r.vim
index 43b208b842..4ea3073922 100644
--- a/runtime/ftplugin/r.vim
+++ b/runtime/ftplugin/r.vim
@@ -1,7 +1,8 @@
" Vim filetype plugin file
" Language: R
" Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com>
-" Last Change: Sun Feb 23, 2014 04:07PM
+" Homepage: https://github.com/jalvesaq/R-Vim-runtime
+" Last Change: Tue Apr 07, 2015 04:38PM
" Only do this when not yet done for this buffer
if exists("b:did_ftplugin")
diff --git a/runtime/ftplugin/rhelp.vim b/runtime/ftplugin/rhelp.vim
index 9b72fb42f9..fdac38f3e9 100644
--- a/runtime/ftplugin/rhelp.vim
+++ b/runtime/ftplugin/rhelp.vim
@@ -1,7 +1,8 @@
" Vim filetype plugin file
" Language: R help file
" Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com>
-" Last Change: Wed Jul 09, 2014 06:23PM
+" Homepage: https://github.com/jalvesaq/R-Vim-runtime
+" Last Change: Tue Apr 07, 2015 04:37PM
" Only do this when not yet done for this buffer
if exists("b:did_ftplugin")
diff --git a/runtime/ftplugin/rmd.vim b/runtime/ftplugin/rmd.vim
index 55723ff396..ec64a07675 100644
--- a/runtime/ftplugin/rmd.vim
+++ b/runtime/ftplugin/rmd.vim
@@ -1,7 +1,8 @@
" Vim filetype plugin file
" Language: R help file
" Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com>
-" Last Change: Wed Jul 09, 2014 06:23PM
+" Homepage: https://github.com/jalvesaq/R-Vim-runtime
+" Last Change: Tue Apr 07, 2015 04:37PM
" Original work by Alex Zvoleff (adjusted for rmd by Michel Kuhlmann)
" Only do this when not yet done for this buffer
diff --git a/runtime/ftplugin/rnoweb.vim b/runtime/ftplugin/rnoweb.vim
index baf53d0108..e184399dcb 100644
--- a/runtime/ftplugin/rnoweb.vim
+++ b/runtime/ftplugin/rnoweb.vim
@@ -1,7 +1,8 @@
" Vim filetype plugin file
" Language: Rnoweb
" Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com>
-" Last Change: Wed Jul 09, 2014 06:23PM
+" Homepage: https://github.com/jalvesaq/R-Vim-runtime
+" Last Change: Tue Apr 07, 2015 04:37PM
" Only do this when not yet done for this buffer
if exists("b:did_ftplugin")
diff --git a/runtime/ftplugin/rrst.vim b/runtime/ftplugin/rrst.vim
index 8140169e61..ecfd6e87a1 100644
--- a/runtime/ftplugin/rrst.vim
+++ b/runtime/ftplugin/rrst.vim
@@ -1,7 +1,8 @@
" Vim filetype plugin file
" Language: reStructuredText documentation format with R code
" Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com>
-" Last Change: Wed Jul 09, 2014 06:23PM
+" Homepage: https://github.com/jalvesaq/R-Vim-runtime
+" Last Change: Tue Apr 07, 2015 04:38PM
" Original work by Alex Zvoleff
" Only do this when not yet done for this buffer
diff --git a/runtime/indent/r.vim b/runtime/indent/r.vim
index 105f0cd7ad..01f3812ed2 100644
--- a/runtime/indent/r.vim
+++ b/runtime/indent/r.vim
@@ -1,7 +1,8 @@
" Vim indent file
" Language: R
" Author: Jakson Alves de Aquino <jalvesaq@gmail.com>
-" Last Change: Thu Mar 26, 2015 05:36PM
+" Homepage: https://github.com/jalvesaq/R-Vim-runtime
+" Last Change: Thu Feb 18, 2016 06:32AM
" Only load this indent file when no other was loaded.
@@ -32,7 +33,7 @@ if ! exists("g:r_indent_ess_compatible")
let g:r_indent_ess_compatible = 0
endif
if ! exists("g:r_indent_op_pattern")
- let g:r_indent_op_pattern = '\(+\|-\|\*\|/\|=\|\~\|%\)$'
+ let g:r_indent_op_pattern = '\(&\||\|+\|-\|\*\|/\|=\|\~\|%\|->\)\s*$'
endif
function s:RDelete_quotes(line)
@@ -265,7 +266,7 @@ function GetRIndent()
return 0
endif
- if cline =~ '^\s*{'
+ if cline =~ '^\s*{' && s:Get_paren_balance(cline, '{', '}') > 0
if g:r_indent_ess_compatible && line =~ ')$'
let nlnum = lnum
let nline = line
@@ -283,7 +284,7 @@ function GetRIndent()
endif
" line is an incomplete command:
- if line =~ '\<\(if\|while\|for\|function\)\s*()$' || line =~ '\<else$' || line =~ '<-$'
+ if line =~ '\<\(if\|while\|for\|function\)\s*()$' || line =~ '\<else$' || line =~ '<-$' || line =~ '->$'
return indent(lnum) + &sw
endif
@@ -344,7 +345,7 @@ function GetRIndent()
endif
let post_block = 0
- if line =~ '}$'
+ if line =~ '}$' && s:Get_paren_balance(line, '{', '}') < 0
let lnum = s:Get_matching_brace(lnum, '{', '}', 0)
let line = SanitizeRLine(getline(lnum))
if lnum > 0 && line =~ '^\s*{'
@@ -359,14 +360,14 @@ function GetRIndent()
let olnum = s:Get_prev_line(lnum)
let oline = getline(olnum)
if olnum > 0
- if line =~ g:r_indent_op_pattern
- if oline =~ g:r_indent_op_pattern
+ if line =~ g:r_indent_op_pattern && s:Get_paren_balance(line, "(", ")") == 0
+ if oline =~ g:r_indent_op_pattern && s:Get_paren_balance(line, "(", ")") == 0
return indent(lnum)
else
return indent(lnum) + &sw
endif
else
- if oline =~ g:r_indent_op_pattern
+ if oline =~ g:r_indent_op_pattern && s:Get_paren_balance(line, "(", ")") == 0
return indent(lnum) - &sw
endif
endif
@@ -471,7 +472,6 @@ function GetRIndent()
endif
let ind = indent(lnum)
- let pind = indent(plnum)
if g:r_indent_align_args == 0 && pb != 0
let ind += pb * &sw
@@ -483,6 +483,12 @@ function GetRIndent()
return ind
endif
+ if plnum > 0
+ let pind = indent(plnum)
+ else
+ let pind = 0
+ endif
+
if ind == pind || (ind == (pind + &sw) && pline =~ '{$' && ppost_else == 0)
return ind
endif
diff --git a/runtime/indent/rhelp.vim b/runtime/indent/rhelp.vim
index 3b37128b2c..9dc2031cb6 100644
--- a/runtime/indent/rhelp.vim
+++ b/runtime/indent/rhelp.vim
@@ -1,7 +1,8 @@
" Vim indent file
" Language: R Documentation (Help), *.Rd
" Author: Jakson Alves de Aquino <jalvesaq@gmail.com>
-" Last Change: Thu Oct 16, 2014 07:07AM
+" Homepage: https://github.com/jalvesaq/R-Vim-runtime
+" Last Change: Tue Apr 07, 2015 04:38PM
" Only load this indent file when no other was loaded.
diff --git a/runtime/indent/rmd.vim b/runtime/indent/rmd.vim
index 9a8a3cb719..88904405e8 100644
--- a/runtime/indent/rmd.vim
+++ b/runtime/indent/rmd.vim
@@ -1,7 +1,8 @@
" Vim indent file
" Language: Rmd
" Author: Jakson Alves de Aquino <jalvesaq@gmail.com>
-" Last Change: Thu Jul 10, 2014 07:11PM
+" Homepage: https://github.com/jalvesaq/R-Vim-runtime
+" Last Change: Tue Apr 07, 2015 04:38PM
" Only load this indent file when no other was loaded.
diff --git a/runtime/indent/rnoweb.vim b/runtime/indent/rnoweb.vim
index d0cad3d8d9..29fa5bc78f 100644
--- a/runtime/indent/rnoweb.vim
+++ b/runtime/indent/rnoweb.vim
@@ -1,7 +1,8 @@
" Vim indent file
" Language: Rnoweb
" Author: Jakson Alves de Aquino <jalvesaq@gmail.com>
-" Last Change: Sun Mar 22, 2015 09:28AM
+" Homepage: https://github.com/jalvesaq/R-Vim-runtime
+" Last Change: Tue Apr 07, 2015 04:38PM
" Only load this indent file when no other was loaded.
diff --git a/runtime/indent/rrst.vim b/runtime/indent/rrst.vim
index 8bfa8344ce..f3ee53e7fb 100644
--- a/runtime/indent/rrst.vim
+++ b/runtime/indent/rrst.vim
@@ -1,7 +1,8 @@
" Vim indent file
" Language: Rrst
" Author: Jakson Alves de Aquino <jalvesaq@gmail.com>
-" Last Change: Wed Jul 09, 2014 07:33PM
+" Homepage: https://github.com/jalvesaq/R-Vim-runtime
+" Last Change: Tue Apr 07, 2015 04:38PM
" Only load this indent file when no other was loaded.
diff --git a/runtime/syntax/python.vim b/runtime/syntax/python.vim
index 6161eb3953..68979a87c2 100644
--- a/runtime/syntax/python.vim
+++ b/runtime/syntax/python.vim
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: Python
" Maintainer: Zvezdan Petkovic <zpetkovic@acm.org>
-" Last Change: 2015 Sep 15
+" Last Change: 2016 Feb 20
" Credits: Neil Schemenauer <nas@python.ca>
" Dmitry Vasiliev
"
@@ -199,6 +199,8 @@ if !exists("python_no_builtin_highlight")
syn keyword pythonBuiltin ascii bytes exec
" non-essential built-in functions; Python 2 only
syn keyword pythonBuiltin apply buffer coerce intern
+ " avoid highlighting attributes as builtins
+ syn match pythonAttribute /\.\h\w*/hs=s+1 contains=ALLBUT,pythonBuiltin transparent
endif
" From the 'Python Library Reference' class hierarchy at the bottom.
diff --git a/runtime/syntax/r.vim b/runtime/syntax/r.vim
index e48b6686cb..d96bf96acb 100644
--- a/runtime/syntax/r.vim
+++ b/runtime/syntax/r.vim
@@ -5,17 +5,21 @@
" Tom Payne <tom@tompayne.org>
" Contributor: Johannes Ranke <jranke@uni-bremen.de>
" Homepage: https://github.com/jalvesaq/R-Vim-runtime
-" Last Change: Wed Oct 21, 2015 06:33AM
+" Last Change: Thu Mar 10, 2016 12:26PM
" Filenames: *.R *.r *.Rhistory *.Rt
"
" NOTE: The highlighting of R functions is defined in
" runtime files created by a filetype plugin, if installed.
"
" CONFIGURATION:
-" syntax folding can be turned on by
+" Syntax folding can be turned on by
"
" let r_syntax_folding = 1
"
+" ROxygen highlighting can be turned off by
+"
+" let r_hl_roxygen = 0
+"
" Some lines of code were borrowed from Zhuojun Chen.
if exists("b:current_syntax")
@@ -24,9 +28,12 @@ endif
setlocal iskeyword=@,48-57,_,.
-if exists("g:r_syntax_folding")
+if exists("g:r_syntax_folding") && g:r_syntax_folding
setlocal foldmethod=syntax
endif
+if !exists("g:r_hl_roxygen")
+ let g:r_hl_roxygen = 1
+endif
syn case match
@@ -35,18 +42,20 @@ syn match rCommentTodo contained "\(BUG\|FIXME\|NOTE\|TODO\):"
syn match rComment contains=@Spell,rCommentTodo,rOBlock "#.*"
" Roxygen
-syn region rOBlock start="^\s*\n#\{1,2}' " start="\%^#\{1,2}' " end="^\(#\{1,2}'\)\@!" contains=rOTitle,rOKeyword,rOExamples,@Spell keepend
-syn region rOTitle start="^\s*\n#\{1,2}' " start="\%^#\{1,2}' " end="^\(#\{1,2}'\s*$\)\@=" contained contains=rOCommentKey
-syn match rOCommentKey "#\{1,2}'" containedin=rOTitle contained
-
-syn region rOExamples start="^#\{1,2}' @examples.*"rs=e+1,hs=e+1 end="^\(#\{1,2}' @.*\)\@=" end="^\(#\{1,2}'\)\@!" contained contains=rOKeyword
-
-syn match rOKeyword contained "@\(param\|return\|name\|rdname\|examples\|example\|include\|docType\)"
-syn match rOKeyword contained "@\(S3method\|TODO\|aliases\|alias\|assignee\|author\|callGraphDepth\|callGraph\)"
-syn match rOKeyword contained "@\(callGraphPrimitives\|concept\|exportClass\|exportMethod\|exportPattern\|export\|formals\)"
-syn match rOKeyword contained "@\(format\|importClassesFrom\|importFrom\|importMethodsFrom\|import\|keywords\|useDynLib\)"
-syn match rOKeyword contained "@\(method\|noRd\|note\|references\|seealso\|setClass\|slot\|source\|title\|usage\)"
-syn match rOKeyword contained "@\(family\|template\|templateVar\|description\|details\|inheritParams\|field\)"
+if g:r_hl_roxygen
+ syn region rOBlock start="^\s*\n#\{1,2}' " start="\%^#\{1,2}' " end="^\(#\{1,2}'\)\@!" contains=rOTitle,rOKeyword,rOExamples,@Spell keepend
+ syn region rOTitle start="^\s*\n#\{1,2}' " start="\%^#\{1,2}' " end="^\(#\{1,2}'\s*$\)\@=" contained contains=rOCommentKey
+ syn match rOCommentKey "#\{1,2}'" containedin=rOTitle contained
+
+ syn region rOExamples start="^#\{1,2}' @examples.*"rs=e+1,hs=e+1 end="^\(#\{1,2}' @.*\)\@=" end="^\(#\{1,2}'\)\@!" contained contains=rOKeyword
+
+ syn match rOKeyword contained "@\(param\|return\|name\|rdname\|examples\|example\|include\|docType\)"
+ syn match rOKeyword contained "@\(S3method\|TODO\|aliases\|alias\|assignee\|author\|callGraphDepth\|callGraph\)"
+ syn match rOKeyword contained "@\(callGraphPrimitives\|concept\|exportClass\|exportMethod\|exportPattern\|export\|formals\)"
+ syn match rOKeyword contained "@\(format\|importClassesFrom\|importFrom\|importMethodsFrom\|import\|keywords\|useDynLib\)"
+ syn match rOKeyword contained "@\(method\|noRd\|note\|references\|seealso\|setClass\|slot\|source\|title\|usage\)"
+ syn match rOKeyword contained "@\(family\|template\|templateVar\|description\|details\|inheritParams\|field\)"
+endif
if &filetype == "rhelp"
@@ -159,12 +168,13 @@ syn match rBraceError "[)}]" contained
syn match rCurlyError "[)\]]" contained
syn match rParenError "[\]}]" contained
-" Source list of R functions produced by a filetype plugin (if installed)
-if has("nvim")
- " Nvim-R
+if !exists("g:R_hi_fun")
+ let g:R_hi_fun = 1
+endif
+if g:R_hi_fun
+ " Nvim-R:
runtime R/functions.vim
-else
- " Vim-R-plugin
+ " Vim-R-plugin:
runtime r-plugin/functions.vim
endif
@@ -235,11 +245,13 @@ hi def link rStatement Statement
hi def link rString String
hi def link rStrError Error
hi def link rType Type
-hi def link rOKeyword Title
-hi def link rOBlock Comment
-hi def link rOTitle Title
-hi def link rOCommentKey Comment
-hi def link rOExamples SpecialComment
+if g:r_hl_roxygen
+ hi def link rOKeyword Title
+ hi def link rOBlock Comment
+ hi def link rOTitle Title
+ hi def link rOCommentKey Comment
+ hi def link rOExamples SpecialComment
+endif
let b:current_syntax="r"
diff --git a/runtime/syntax/rhelp.vim b/runtime/syntax/rhelp.vim
index 32c91add48..47c764e296 100644
--- a/runtime/syntax/rhelp.vim
+++ b/runtime/syntax/rhelp.vim
@@ -2,25 +2,21 @@
" Language: R Help File
" Maintainer: Jakson Aquino <jalvesaq@gmail.com>
" Former Maintainer: Johannes Ranke <jranke@uni-bremen.de>
-" Last Change: Wed Jul 09, 2014 10:28PM
+" Homepage: https://github.com/jalvesaq/R-Vim-runtime
+" Last Change: Sat Feb 06, 2016 11:34AM
" Remarks: - Includes R syntax highlighting in the appropriate
" sections if an r.vim file is in the same directory or in the
" default debian location.
" - There is no Latex markup in equations
" - Thanks to Will Gray for finding and fixing a bug
-" - No support for \if, \ifelse and \out as I don't understand
-" them and have no examples at hand (help welcome).
-" - No support for \var tag within quoted string (dito)
+" - No support for \var tag within quoted string
" Version Clears: {{{1