aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2022-04-19 15:14:17 +0200
committerGitHub <noreply@github.com>2022-04-19 15:14:17 +0200
commit0124a7bfa9e27796e561cb0b3a045b9327bf7077 (patch)
tree86f767630011a459ab189e0b5455b48abd2ab1c8
parent147cc60d24f093b5154824889f2151489774ef33 (diff)
downloadrneovim-0124a7bfa9e27796e561cb0b3a045b9327bf7077.tar.gz
rneovim-0124a7bfa9e27796e561cb0b3a045b9327bf7077.tar.bz2
rneovim-0124a7bfa9e27796e561cb0b3a045b9327bf7077.zip
vim-patch:75ab590f8504 (#18170)
Update runtime files https://github.com/vim/vim/commit/75ab590f8504a8912ca0b8c58f6b897bb7a34f07 omit builtin.txt change to `expand()` (depends on 8.2.4726)
-rw-r--r--runtime/autoload/dist/ft.vim2
-rw-r--r--runtime/doc/autocmd.txt27
-rw-r--r--runtime/doc/builtin.txt2
-rw-r--r--runtime/doc/change.txt2
-rw-r--r--runtime/doc/editing.txt5
-rw-r--r--runtime/doc/eval.txt2
-rw-r--r--runtime/doc/motion.txt2
-rw-r--r--runtime/doc/nvim_terminal_emulator.txt3
-rw-r--r--runtime/doc/syntax.txt2
-rw-r--r--runtime/filetype.vim2
-rw-r--r--runtime/indent/README.txt2
-rw-r--r--runtime/indent/krl.vim130
-rw-r--r--runtime/indent/testdir/krl.in148
-rw-r--r--runtime/indent/testdir/krl.ok148
-rw-r--r--runtime/pack/dist/opt/termdebug/plugin/termdebug.vim71
-rw-r--r--runtime/syntax/krl.vim458
-rw-r--r--runtime/syntax/openscad.vim129
-rw-r--r--runtime/syntax/synload.vim2
-rw-r--r--runtime/syntax/syntax.vim2
19 files changed, 1088 insertions, 51 deletions
diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim
index 975e2c23d8..14dd88b7a8 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: 2022 Apr 06
+" Last Change: 2022 Apr 13
" These functions are moved here from runtime/filetype.vim to make startup
" faster.
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 07158982f2..bf231044a0 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -69,6 +69,7 @@ Or use `:execute`: >
:augroup mine | exe "au! BufRead *" | augroup END
:augroup mine | exe "au BufRead * set tw=70" | augroup END
+< *autocmd-expand*
Note that special characters (e.g., "%", "<cword>") in the ":autocmd"
arguments are not expanded when the autocommand is defined. These will be
expanded when the Event is recognized, and the {cmd} is executed. The only
@@ -275,14 +276,14 @@ BufRead or BufReadPost When starting to edit a new buffer, after
processing modelines. See |BufWinEnter| to do
something after processing modelines.
Also triggered:
- - when writing an unnamed buffer such that the
- buffer gets a name
+ - when writing an unnamed buffer in a way that
+ the buffer gets a name
- after successfully recovering a file
- for the "filetypedetect" group when
executing ":filetype detect"
Not triggered:
- - for ":r file"
- - if the file doesn't exist
+ - for the `:read file` command
+ - when the file doesn't exist
*BufReadCmd*
BufReadCmd Before starting to edit a new buffer. Should
read the file into the buffer. |Cmd-event|
@@ -542,6 +543,15 @@ DirChangedPre When the |current-directory| is going to be
switching window (or tab)
<afile> is set to the new directory name.
Non-recursive (event cannot trigger itself).
+ *ExitPre*
+ExitPre When using `:quit`, `:wq` in a way it makes
+ Vim exit, or using `:qall`, just after
+ |QuitPre|. Can be used to close any
+ non-essential window. Exiting may still be
+ cancelled if there is a modified buffer that
+ isn't automatically saved, use |VimLeavePre|
+ for really exiting.
+ See also |QuitPre|, |WinClosed|.
*FileAppendCmd*
FileAppendCmd Before appending to a file. Should do the
appending to the file. Use the '[ and ']
@@ -568,15 +578,6 @@ FileChangedRO Before making the first change to a read-only
*E881*
If the number of lines changes saving for undo
may fail and the change will be aborted.
- *ExitPre*
-ExitPre When using `:quit`, `:wq` in a way it makes
- Vim exit, or using `:qall`, just after
- |QuitPre|. Can be used to close any
- non-essential window. Exiting may still be
- cancelled if there is a modified buffer that
- isn't automatically saved, use |VimLeavePre|
- for really exiting.
- See also |QuitPre|, |WinClosed|.
*FileChangedShell*
FileChangedShell When Vim notices that the modification time of
a file has changed since editing started.
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 7871885a5d..81d7f4b83a 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -1809,7 +1809,7 @@ execute({command} [, {silent}]) *execute()*
`:redir`, error messages are dropped.
To get a list of lines use |split()| on the result: >
- split(execute('args'), "\n")
+ execute('args')->split("\n")
< This function is not available in the |sandbox|.
Note: If nested, an outer execute() will not observe output of
diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt
index 0d19f025ec..8e666484d7 100644
--- a/runtime/doc/change.txt
+++ b/runtime/doc/change.txt
@@ -583,7 +583,7 @@ attack or other people reading your file). When Vim exits the directory and
all files in it are deleted. When Vim has the setuid bit set this may cause
problems, the temp file is owned by the setuid user but the filter command
probably runs as the original user.
-Directory for temporary files is created in the first suitable directory of:
+Directory for temporary files is created in the first possible directory of:
Unix: $TMPDIR, /tmp, current-dir, $HOME.
Windows: $TMPDIR, $TMP, $TEMP, $USERPROFILE, current-dir.
diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt
index 1cc8c21462..b25d5e89bd 100644
--- a/runtime/doc/editing.txt
+++ b/runtime/doc/editing.txt
@@ -412,7 +412,8 @@ does apply like to other wildcards.
Environment variables in the expression are expanded when evaluating the
expression, thus this works: >
:e `=$HOME .. '/.vimrc'`
-This does not work, $HOME is inside a string and used literally: >
+This uses $HOME inside a string and it will be used literally, most likely not
+what you intended: >
:e `='$HOME' .. '/.vimrc'`
If the expression returns a string then names are to be separated with line
@@ -1494,7 +1495,7 @@ session or with another command (e.g., a filter command). Then you will know
which version of the file you want to keep.
The accuracy of the time check depends on the filesystem. On Unix it is
-usually sub-second. With old file sytems and on MS-Windows it is normally one
+usually sub-second. With old file systems and on MS-Windows it is normally one
second. Use `has('nanotime')` to check if sub-second time stamp checks are
available.
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index e3d4ef2085..2f3602caa1 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -4302,7 +4302,7 @@ parentheses can be cut out from |v:exception| with the ":substitute" command.
:
:try
:
- : " something with arithmetics and I/O
+ : " something with arithmetic and I/O
:
:catch /^EXCEPT:MATHERR:RANGE/
: let function = substitute(v:exception, '.*(\(\a\+\)).*', '\1', "")
diff --git a/runtime/doc/motion.txt b/runtime/doc/motion.txt
index 2cc6842402..228d1fcb87 100644
--- a/runtime/doc/motion.txt
+++ b/runtime/doc/motion.txt
@@ -1045,7 +1045,7 @@ in the current file (an indent is removed and a long line is truncated to fit
in the window).
The marker ">" indicates the current position in the jumplist. It may not be
-shown when filtering the |:jump| command using |:filter|
+shown when filtering the |:jumps| command using |:filter|
You are currently in line 1167. If you then use the CTRL-O command, the
cursor is put in line 1154. This results in:
diff --git a/runtime/doc/nvim_terminal_emulator.txt b/runtime/doc/nvim_terminal_emulator.txt
index 9ac81e2916..0e2b048541 100644
--- a/runtime/doc/nvim_terminal_emulator.txt
+++ b/runtime/doc/nvim_terminal_emulator.txt
@@ -265,6 +265,8 @@ Put focus on the gdb window to type commands there. Some common ones are:
- next execute the current line and stop at the next line
- step execute the current line and stop at the next statement,
entering functions
+- until execute until past the current cursor line or past a specified
+ position or the current stack frame returns
- finish execute until leaving the current function
- where show the stack
- frame N go to the Nth stack frame
@@ -281,6 +283,7 @@ gdb:
*:Step* execute the gdb "step" command
*:Over* execute the gdb "next" command (`:Next` is a Vim command)
+ *:Until* execute the gdb "until" command
*:Finish* execute the gdb "finish" command
*:Continue* execute the gdb "continue" command
*:Stop* interrupt the program
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index 6875f43b86..4e3900aeed 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -188,7 +188,7 @@ A syntax group name doesn't specify any color or attributes itself.
The name for a highlight or syntax group must consist of ASCII letters, digits
and the underscore. As a regexp: "[a-zA-Z0-9_]*". However, Vim does not give
-an error when using other characters. The maxium length of a group name is
+an error when using other characters. The maximum length of a group name is
about 200 bytes. *E1249*
To be able to allow each user to pick their favorite set of colors, there must
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index 5e73374649..ab300dcc29 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: 2022 Apr 07
+" Last Change: 2022 Apr 13
" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
diff --git a/runtime/indent/README.txt b/runtime/indent/README.txt
index 8b114365c6..649870636e 100644
--- a/runtime/indent/README.txt
+++ b/runtime/indent/README.txt
@@ -31,7 +31,7 @@ Always use ":setlocal" to set 'indentexpr'. This avoids it being carried over
to other buffers.
To trigger the indenting after typing a word like "endif", add the word to the
-'cinkeys' option with "+=".
+'indentkeys' option with "+=".
You normally set 'indentexpr' to evaluate a function and then define that
function. That function only needs to be defined once for as long as Vim is
diff --git a/runtime/indent/krl.vim b/runtime/indent/krl.vim
new file mode 100644
index 0000000000..cc3cbd1abb
--- /dev/null
+++ b/runtime/indent/krl.vim
@@ -0,0 +1,130 @@
+" Vim indent file
+" Language: Kuka Robot Language
+" Maintainer: Patrick Meiser-Knosowski <knosowski@graeffrobotics.de>
+" Version: 3.0.0
+" Last Change: 15. Apr 2022
+" Credits: Based on indent/vim.vim
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+
+setlocal nolisp
+setlocal nocindent
+setlocal nosmartindent
+setlocal autoindent
+setlocal indentexpr=GetKrlIndent()
+setlocal indentkeys=!^F,o,O,=~end,0=~else,0=~case,0=~default,0=~until,0=~continue,=~part
+let b:undo_indent = "setlocal lisp< cindent< smartindent< autoindent< indentexpr< indentkeys<"
+
+if get(g:,'krlSpaceIndent',1)
+ " Use spaces, not tabs, for indention, 2 is enough.
+ " More or even tabs would waste valuable space on the teach pendant.
+ setlocal softtabstop=2
+ setlocal shiftwidth=2
+ setlocal expandtab
+ setlocal shiftround
+ let b:undo_indent = b:undo_indent." softtabstop< shiftwidth< expandtab< shiftround<"
+endif
+
+" Only define the function once.
+if exists("*GetKrlIndent")
+ finish
+endif
+let s:keepcpo = &cpo
+set cpo&vim
+
+function GetKrlIndent() abort
+
+ let currentLine = getline(v:lnum)
+ if currentLine =~? '\v^;(\s*(end)?fold>)@!' && !get(g:, 'krlCommentIndent', 0)
+ " If current line has a ; in column 1 and is no fold, keep zero indent.
+ " This may be usefull if code is commented out at the first column.
+ return 0
+ endif
+
+ " Find a non-blank line above the current line.
+ let preNoneBlankLineNum = s:KrlPreNoneBlank(v:lnum - 1)
+ if preNoneBlankLineNum == 0
+ " At the start of the file use zero indent.
+ return 0
+ endif
+
+ let preNoneBlankLine = getline(preNoneBlankLineNum)
+ let ind = indent(preNoneBlankLineNum)
+
+ " Define add 'shiftwidth' pattern
+ let addShiftwidthPattern = '\v^\s*('
+ if get(g:, 'krlIndentBetweenDef', 1)
+ let addShiftwidthPattern ..= '(global\s+)?def(fct|dat)?\s+\$?\w'
+ let addShiftwidthPattern ..= '|'
+ endif
+ let addShiftwidthPattern ..= 'if>|while>|for>|loop>'
+ let addShiftwidthPattern ..= '|else>'
+ let addShiftwidthPattern ..= '|case>|default>'
+ let addShiftwidthPattern ..= '|repeat>'
+ let addShiftwidthPattern ..= '|skip>|(ptp_)?spline>'
+ let addShiftwidthPattern ..= '|time_block\s+(start|part)>'
+ let addShiftwidthPattern ..= '|const_vel\s+start>'
+ let addShiftwidthPattern ..= ')'
+
+ " Define Subtract 'shiftwidth' pattern
+ let subtractShiftwidthPattern = '\v^\s*('
+ if get(g:, 'krlIndentBetweenDef', 1)
+ let subtractShiftwidthPattern ..= 'end(fct|dat)?>'
+ let subtractShiftwidthPattern ..= '|'
+ endif
+ let subtractShiftwidthPattern ..= 'end(if|while|for|loop)>'
+ let subtractShiftwidthPattern ..= '|else>'
+ let subtractShiftwidthPattern ..= '|case>|default>|endswitch>'
+ let subtractShiftwidthPattern ..= '|until>'
+ let subtractShiftwidthPattern ..= '|end(skip|spline)>'
+ let subtractShiftwidthPattern ..= '|time_block\s+(part|end)>'
+ let subtractShiftwidthPattern ..= '|const_vel\s+end>'
+ let subtractShiftwidthPattern ..= ')'
+
+ " Add shiftwidth
+ if preNoneBlankLine =~? addShiftwidthPattern
+ let ind += &sw
+ endif
+
+ " Subtract shiftwidth
+ if currentLine =~? subtractShiftwidthPattern
+ let ind = ind - &sw
+ endif
+
+ " First case after a switch gets the indent of the switch.
+ if currentLine =~? '\v^\s*case>'
+ \&& preNoneBlankLine =~? '\v^\s*switch>'
+ let ind = ind + &sw
+ endif
+
+ " align continue with the following instruction
+ if currentLine =~? '\v^\s*continue>'
+ \&& getline(v:lnum + 1) =~? subtractShiftwidthPattern
+ let ind = ind - &sw
+ endif
+
+ return ind
+endfunction
+
+" This function works almost like prevnonblank() but handles &-headers,
+" comments and continue instructions like blank lines
+function s:KrlPreNoneBlank(lnum) abort
+
+ let nPreNoneBlank = prevnonblank(a:lnum)
+
+ while nPreNoneBlank > 0 && getline(nPreNoneBlank) =~? '\v^\s*(\&\w\+|;|continue>)'
+ " Previouse none blank line irrelevant. Look further aback.
+ let nPreNoneBlank = prevnonblank(nPreNoneBlank - 1)
+ endwhile
+
+ return nPreNoneBlank
+endfunction
+
+let &cpo = s:keepcpo
+unlet s:keepcpo
+
+" vim:sw=2 sts=2 et
diff --git a/runtime/indent/testdir/krl.in b/runtime/indent/testdir/krl.in
new file mode 100644
index 0000000000..ec90feb08b
--- /dev/null
+++ b/runtime/indent/testdir/krl.in
@@ -0,0 +1,148 @@
+; vim: set ft=krl :
+
+; START_INDENT
+
+def One()
+int i
+If i==1 then
+While i>=1
+For i=1 to 5 step 2
+Loop
+i = i+1
+EndLoop
+EndFor
+EndWhile
+Else
+Repeat
+Switch i
+Case 1
+Skip 123
+i = i+1
+EndSkip 123
+Spline with $acc=100, $vel.cp=3
+slin {x 100}
+scirc {x 110, y 110}, {x 120, y 90}
+slin {x 200} c_dis
+Time_Block Start
+slin {x 300} c_dis
+Time_Block Part = 22.2
+slin {y 400} c_dis
+Time_Block Part = 33.3
+Time_Block End = 10
+slin {y 200} c_dis
+Const_Vel Start +100 OnStart
+slin {y 300} c_dis
+slin {x 100}
+Const_Vel End -5.5
+slin {y 200} c_dis
+EndSpline
+Case 2,3
+PTP_Spline with $acc=100, $vel.ptp=100
+sptp {a1 0} c_ptp
+sptp {a1 90}
+EndSpline c_spl
+Default
+i = i+1
+EndSwitch
+Continue
+Until False
+EndIf
+end
+
+DEF Two()
+int i
+END
+
+global def Three()
+int i
+end
+
+GLOBAL DEF Four()
+int i
+END
+
+Global Def Five()
+int i
+End
+
+deffct bool fOne()
+int i
+endfct
+
+DEFFCT bool fTwo()
+int i
+ENDFCT
+
+global deffct bool fThree()
+int i
+endfct
+
+GLOBAL DEFFCT bool fFour()
+int i
+ENDFCT
+
+Global DefFct bool fFive()
+int i
+EndFct
+
+DefDat datfile()
+global int i=1
+; don't indent column 1 comments unless g:krlCommentIndent is set
+; global int o=2
+EndDat
+
+; END_INDENT
+
+; START_INDENT
+; INDENT_EXE let g:krlSpaceIndent = 0
+; INDENT_EXE set shiftwidth=4
+
+def bla()
+int i
+end
+
+; END_INDENT
+
+; START_INDENT
+; INDENT_EXE let g:krlCommentIndent = 1
+def bla()
+; indent this first column comment because of g:krlCommentIndent=1
+end
+; END_INDENT
+
+; START_INDENT
+; INDENT_EXE let g:krlIndentBetweenDef = 0
+def bla()
+int i ; don't indent this line because of g:krlIndentBetweenDef=0
+end
+; END_INDENT
+
+; START_INDENT
+; INDENT_AT this-line
+def Some()
+int f
+if true then
+f = 1 ; this-line
+endif
+end
+; END_INDENT
+
+; START_INDENT
+; INDENT_NEXT next-line
+def Some()
+ int i
+ ; next-line
+i = 1 ; should get indent of line 'int i' above
+end
+; END_INDENT
+
+; START_INDENT
+; INDENT_PREV prev-line
+def Some()
+int f
+if true then
+f = 1
+; prev-line
+endif
+end
+; END_INDENT
diff --git a/runtime/indent/testdir/krl.ok b/runtime/indent/testdir/krl.ok
new file mode 100644
index 0000000000..34dc0f57b1
--- /dev/null
+++ b/runtime/indent/testdir/krl.ok
@@ -0,0 +1,148 @@
+; vim: set ft=krl :
+
+; START_INDENT
+
+def One()
+ int i
+ If i==1 then
+ While i>=1
+ For i=1 to 5 step 2
+ Loop
+ i = i+1
+ EndLoop
+ EndFor
+ EndWhile
+ Else
+ Repeat
+ Switch i
+ Case 1
+ Skip 123
+ i = i+1
+ EndSkip 123
+ Spline with $acc=100, $vel.cp=3
+ slin {x 100}
+ scirc {x 110, y 110}, {x 120, y 90}
+ slin {x 200} c_dis
+ Time_Block Start
+ slin {x 300} c_dis
+ Time_Block Part = 22.2
+ slin {y 400} c_dis
+ Time_Block Part = 33.3
+ Time_Block End = 10
+ slin {y 200} c_dis
+ Const_Vel Start +100 OnStart
+ slin {y 300} c_dis
+ slin {x 100}
+ Const_Vel End -5.5
+ slin {y 200} c_dis
+ EndSpline
+ Case 2,3
+ PTP_Spline with $acc=100, $vel.ptp=100
+ sptp {a1 0} c_ptp
+ sptp {a1 90}
+ EndSpline c_spl
+ Default
+ i = i+1
+ EndSwitch
+ Continue
+ Until False
+ EndIf
+end
+
+DEF Two()
+ int i
+END
+
+global def Three()
+ int i
+end
+
+GLOBAL DEF Four()
+ int i
+END
+
+Global Def Five()
+ int i
+End
+
+deffct bool fOne()
+ int i
+endfct
+
+DEFFCT bool fTwo()
+ int i
+ENDFCT
+
+global deffct bool fThree()
+ int i
+endfct
+
+GLOBAL DEFFCT bool fFour()
+ int i
+ENDFCT
+
+Global DefFct bool fFive()
+ int i
+EndFct
+
+DefDat datfile()
+ global int i=1
+; don't indent column 1 comments unless g:krlCommentIndent is set
+; global int o=2
+EndDat
+
+; END_INDENT
+
+; START_INDENT
+; INDENT_EXE let g:krlSpaceIndent = 0
+; INDENT_EXE set shiftwidth=4
+
+def bla()
+ int i
+end
+
+; END_INDENT
+
+; START_INDENT
+; INDENT_EXE let g:krlCommentIndent = 1
+def bla()
+ ; indent this first column comment because of g:krlCommentIndent=1
+end
+; END_INDENT
+
+; START_INDENT
+; INDENT_EXE let g:krlIndentBetweenDef = 0
+def bla()
+int i ; don't indent this line because of g:krlIndentBetweenDef=0
+end
+; END_INDENT
+
+; START_INDENT
+; INDENT_AT this-line
+def Some()
+int f
+if true then
+ f = 1 ; this-line
+endif
+end
+; END_INDENT
+
+; START_INDENT
+; INDENT_NEXT next-line
+def Some()
+ int i
+ ; next-line
+ i = 1 ; should get indent of line 'int i' above
+end
+; END_INDENT
+
+; START_INDENT
+; INDENT_PREV prev-line
+def Some()
+int f
+if true then
+ f = 1
+; prev-line
+endif
+end
+; END_INDENT
diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
index 71456e788d..8a7dcb0e75 100644
--- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
+++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
@@ -2,7 +2,7 @@
"
" Author: Bram Moolenaar
" Copyright: Vim license applies, see ":help license"
-" Last Change: 2022 Jan 17
+" Last Change: 2022 Apr 16
"
" WORK IN PROGRESS - The basics works stable, more to come
" Note: In general you need at least GDB 7.12 because this provides the
@@ -466,7 +466,7 @@ endfunc
func s:StartDebugCommon(dict)
" Sign used to highlight the line where the program has stopped.
" There can be only one.
- sign define debugPC linehl=debugPC
+ call sign_define('debugPC', #{linehl: 'debugPC'})
" Install debugger commands in the text window.
call win_gotoid(s:sourcewin)
@@ -700,7 +700,9 @@ func s:EndDebugCommon()
endif
endif
endfor
- exe was_buf .. "buf"
+ if bufexists(was_buf)
+ exe was_buf .. "buf"
+ endif
call s:DeleteCommands()
@@ -759,8 +761,8 @@ func s:HandleDisasmMsg(msg)
let lnum = search('^' . s:asm_addr)
if lnum != 0
- exe 'sign unplace ' . s:asm_id
- exe 'sign place ' . s:asm_id . ' line=' . lnum . ' name=debugPC'
+ call sign_unplace('TermDebug', #{id: s:asm_id})
+ call sign_place(s:asm_id, 'TermDebug', 'debugPC', '%', #{lnum: lnum})
endif
call win_gotoid(curwinid)
@@ -846,6 +848,7 @@ func s:InstallCommands()
command Clear call s:ClearBreakpoint()
command Step call s:SendResumingCommand('-exec-step')
command Over call s:SendResumingCommand('-exec-next')
+ command -nargs=? Until call s:Until(<q-args>)
command Finish call s:SendResumingCommand('-exec-finish')
command -nargs=* Run call s:Run(<q-args>)
command -nargs=* Arguments call s:SendResumingCommand('-exec-arguments ' . <q-args>)
@@ -904,6 +907,7 @@ func s:DeleteCommands()
delcommand Clear
delcommand Step
delcommand Over
+ delcommand Until
delcommand Finish
delcommand Run
delcommand Arguments
@@ -933,22 +937,30 @@ func s:DeleteCommands()
unlet s:k_map_saved
endif
- exe 'sign unplace ' . s:pc_id
- for [id, entries] in items(s:breakpoints)
- for subid in keys(entries)
- exe 'sign unplace ' . s:Breakpoint2SignNumber(id, subid)
- endfor
- endfor
+ call sign_unplace('TermDebug')
unlet s:breakpoints
unlet s:breakpoint_locations
- sign undefine debugPC
- for val in s:BreakpointSigns
- exe "sign undefine debugBreakpoint" . val
- endfor
+ call sign_undefine('debugPC')
+ call sign_undefine(s:BreakpointSigns->map("'debugBreakpoint' .. v:val"))
let s:BreakpointSigns = []
endfunc
+" :Until - Execute until past a specified position or current line
+func s:Until(at)
+ if s:stopped
+ " reset s:stopped here, it may take a bit of time before we get a response
+ let s:stopped = 0
+ " call ch_log('assume that program is running after this command')
+ " Use the fname:lnum format
+ let at = empty(a:at) ?
+ \ fnameescape(expand('%:p')) . ':' . line('.') : a:at
+ call s:SendCommand('-exec-until ' . at)
+ " else
+ " call ch_log('dropping command, program is running: exec-until')
+ endif
+endfunc
+
" :Break - Set a breakpoint at the cursor position.
func s:SetBreakpoint(at)
" Setting a breakpoint may not work while the program is running.
@@ -982,7 +994,8 @@ func s:ClearBreakpoint()
" Assume this always works, the reply is simply "^done".
call s:SendCommand('-break-delete ' . id)
for subid in keys(s:breakpoints[id])
- exe 'sign unplace ' . s:Breakpoint2SignNumber(id, subid)
+ call sign_unplace('TermDebug',
+ \ #{id: s:Breakpoint2SignNumber(id, subid)})
endfor
unlet s:breakpoints[id]
unlet s:breakpoint_locations[bploc][idx]
@@ -1304,8 +1317,8 @@ func s:GotoAsmwinOrCreateIt()
call s:SendCommand('disassemble $pc')
endif
else
- exe 'sign unplace ' . s:asm_id
- exe 'sign place ' . s:asm_id . ' line=' . lnum . ' name=debugPC'
+ call sign_unplace('TermDebug', #{id: s:asm_id})
+ call sign_place(s:asm_id, 'TermDebug', 'debugPC', '%', #{lnum: lnum})
endif
endif
endfunc
@@ -1340,8 +1353,8 @@ func s:HandleCursor(msg)
if lnum == 0
call s:SendCommand('disassemble $pc')
else
- exe 'sign unplace ' . s:asm_id
- exe 'sign place ' . s:asm_id . ' line=' . lnum . ' name=debugPC'
+ call sign_unplace('TermDebug', #{id: s:asm_id})
+ call sign_place(s:asm_id, 'TermDebug', 'debugPC', '%', #{lnum: lnum})
endif
call win_gotoid(curwinid)
@@ -1378,8 +1391,9 @@ func s:HandleCursor(msg)
endif
exe lnum
normal! zv
- exe 'sign unplace ' . s:pc_id
- exe 'sign place ' . s:pc_id . ' line=' . lnum . ' name=debugPC file=' . fname
+ call sign_unplace('TermDebug', #{id: s:pc_id})
+ call sign_place(s:pc_id, 'TermDebug', 'debugPC', fname,
+ \ #{lnum: lnum, priority: 110})
if !exists('b:save_signcolumn')
let b:save_signcolumn = &signcolumn
call add(s:signcolumn_buflist, bufnr())
@@ -1387,7 +1401,7 @@ func s:HandleCursor(msg)
setlocal signcolumn=yes
endif
elseif !s:stopped || fname != ''
- exe 'sign unplace ' . s:pc_id
+ call sign_unplace('TermDebug', #{id: s:pc_id})
endif
call win_gotoid(wid)
@@ -1404,7 +1418,9 @@ func s:CreateBreakpoint(id, subid, enabled)
else
let hiName = "debugBreakpoint"
endif
- exe "sign define debugBreakpoint" . nr . " text=" . substitute(nr, '\..*', '', '') . " texthl=" . hiName
+ call sign_define('debugBreakpoint' .. nr,
+ \ #{text: substitute(nr, '\..*', '', ''),
+ \ texthl: hiName})
endif
endfunc
@@ -1482,7 +1498,9 @@ endfunc
func s:PlaceSign(id, subid, entry)
let nr = printf('%d.%d', a:id, a:subid)
- exe 'sign place ' . s:Breakpoint2SignNumber(a:id, a:subid) . ' line=' . a:entry['lnum'] . ' name=debugBreakpoint' . nr . ' priority=110 file=' . a:entry['fname']
+ call sign_place(s:Breakpoint2SignNumber(a:id, a:subid), 'TermDebug',
+ \ 'debugBreakpoint' .. nr, a:entry['fname'],
+ \ #{lnum: a:entry['lnum'], priority: 110})
let a:entry['placed'] = 1
endfunc
@@ -1496,7 +1514,8 @@ func s:HandleBreakpointDelete(msg)
if has_key(s:breakpoints, id)
for [subid, entry] in items(s:breakpoints[id])
if has_key(entry, 'placed')
- exe 'sign unplace ' . s:Breakpoint2SignNumber(id, subid)
+ call sign_unplace('TermDebug',
+ \ #{id: s:Breakpoint2SignNumber(id, subid)})
unlet entry['placed']
endif
endfor
diff --git a/runtime/syntax/krl.vim b/runtime/syntax/krl.vim
new file mode 100644
index 0000000000..a50790841e
--- /dev/null
+++ b/runtime/syntax/krl.vim
@@ -0,0 +1,458 @@
+" Vim syntax file
+" Language: Kuka Robot Language
+" Maintainer: Patrick Meiser-Knosowski <knosowski@graeffrobotics.de>
+" Version: 3.0.0
+" Last Change: 18. Apr 2022
+" Credits: Thanks for contributions to this to Michael Jagusch
+" Thanks for beta testing to Thomas Baginski
+"
+" Note to self:
+" for testing perfomance
+" open a 1000 lines file.
+" :syntime on
+" G
+" hold down CTRL-U until reaching top
+" :syntime report
+
+" Init {{{
+if exists("b:current_syntax")
+ finish
+endif
+
+let s:keepcpo = &cpo
+set cpo&vim
+
+" if colorscheme is tortus(less)? krlGroupName defaults to 1
+if get(g:, 'colors_name', " ") =~ '\<tortus'
+ \&& !exists("g:krlGroupName")
+ let g:krlGroupName=1
+endif
+" krlGroupName defaults to 0 if it's not initialized yet or 0
+if !get(g:, "krlGroupName", 0)
+ let g:krlGroupName = 0
+endif
+
+" krl does ignore case
+syn case ignore
+" take #, $ and & into keyword (syntax only)
+syn iskeyword @,48-57,_,192-255,#,$,&
+" spell checking
+syn spell notoplevel
+" }}} init
+
+" Comment and Folding {{{
+
+" Special Comment
+
+" TODO Comment
+syn keyword krlTodo contained TODO FIXME XXX
+highlight default link krlTodo Todo
+
+" Debug Comment
+syn keyword krlDebug contained DEBUG
+highlight default link krlDebug Debug
+
+" Comment
+" none move fold comment until second ;
+syn match krlFoldComment /\c\v^\s*;\s*%(end)?fold>[^;]*/ containedin=krlFold contains=krlSingleQuoteString,krlInteger,krlFloat,krlMovement,krlDelimiter,krlBoolean
+highlight default link krlFoldComment Comment
+
+" move fold comment until second ;
+syn match krlMoveFoldComment /\c\v^\s*;\s*fold>[^;]*<s?%(ptp|lin|circ|spl)(_rel)?>[^;]*/ containedin=krlFold contains=krlInteger,krlFloat,krlMovement,krlDelimiter
+highlight default link krlMoveFoldComment Comment
+
+" things to highlight in a fold line
+syn keyword krlFoldHighlights CONT IN SYN OUT containedin=krlFoldComment
+syn match krlFoldHighlights /\c\v<(M|F|E|A|t|i|bin|binin|UP|SPSMAKRO)\d+>/ containedin=krlFoldComment
+if g:krlGroupName
+ highlight default link krlFoldHighlights Sysvars
+else
+ " default color for Fold Highlights
+endif
+syn keyword krlVkrcFoldConstants EIN AUS containedin=krlFoldComment
+highlight default link krlVkrcFoldConstants Boolean
+
+" Comment without Fold, also includes endfold lines and fold line part after second ;
+syn match krlComment /\c\v;\s*