aboutsummaryrefslogtreecommitdiff
path: root/runtime/indent
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2023-02-28 09:34:27 +0100
committerGitHub <noreply@github.com>2023-02-28 09:34:27 +0100
commit66c384d4e806a5e8de53bc57a05f0ddd8c8a9d1c (patch)
tree0744198130c837d09161138c1a60f6a4a5c47335 /runtime/indent
parent8acb3d742ce68adadf1def9e1d1bb5bfd671988c (diff)
downloadrneovim-66c384d4e806a5e8de53bc57a05f0ddd8c8a9d1c.tar.gz
rneovim-66c384d4e806a5e8de53bc57a05f0ddd8c8a9d1c.tar.bz2
rneovim-66c384d4e806a5e8de53bc57a05f0ddd8c8a9d1c.zip
vim-patch:partial:dd60c365cd26 (#22437)
vim-patch:partial:dd60c365cd26 Update runtime files https://github.com/vim/vim/commit/dd60c365cd2630794be84d63c4fe287124a30b97 Co-authored-by: Bram Moolenaar <Bram@vim.org> Skip: eval.txt, repeat.txt (needs `getscriptinfo()`)
Diffstat (limited to 'runtime/indent')
-rw-r--r--runtime/indent/quarto.vim1
-rw-r--r--runtime/indent/r.vim14
-rw-r--r--runtime/indent/rhelp.vim4
-rw-r--r--runtime/indent/rmd.vim6
-rw-r--r--runtime/indent/rnoweb.vim4
-rw-r--r--runtime/indent/rrst.vim4
6 files changed, 24 insertions, 9 deletions
diff --git a/runtime/indent/quarto.vim b/runtime/indent/quarto.vim
new file mode 100644
index 0000000000..586d232d2b
--- /dev/null
+++ b/runtime/indent/quarto.vim
@@ -0,0 +1 @@
+runtime indent/rmd.vim
diff --git a/runtime/indent/r.vim b/runtime/indent/r.vim
index ca85a2e62d..293dd98175 100644
--- a/runtime/indent/r.vim
+++ b/runtime/indent/r.vim
@@ -2,7 +2,7 @@
" Language: R
" Author: Jakson Alves de Aquino <jalvesaq@gmail.com>
" Homepage: https://github.com/jalvesaq/R-Vim-runtime
-" Last Change: Sun Aug 19, 2018 09:13PM
+" Last Change: Wed Oct 26, 2022 12:04PM
" Only load this indent file when no other was loaded.
@@ -14,6 +14,8 @@ let b:did_indent = 1
setlocal indentkeys=0{,0},:,!^F,o,O,e
setlocal indentexpr=GetRIndent()
+let b:undo_indent = "setl inde< indk<"
+
" Only define the function once.
if exists("*GetRIndent")
finish
@@ -28,7 +30,7 @@ let g:r_indent_ess_comments = get(g:, 'r_indent_ess_comments', 0)
let g:r_indent_comment_column = get(g:, 'r_indent_comment_column', 40)
let g:r_indent_ess_compatible = get(g:, 'r_indent_ess_compatible', 0)
let g:r_indent_op_pattern = get(g:, 'r_indent_op_pattern',
- \ '\(&\||\|+\|-\|\*\|/\|=\|\~\|%\|->\)\s*$')
+ \ '\(&\||\|+\|-\|\*\|/\|=\|\~\|%\|->\||>\)\s*$')
function s:RDelete_quotes(line)
let i = 0
@@ -359,17 +361,19 @@ function GetRIndent()
let olnum = s:Get_prev_line(lnum)
let oline = getline(olnum)
if olnum > 0
- 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
+ if substitute(line, '#.*', '', '') =~ g:r_indent_op_pattern && s:Get_paren_balance(line, "(", ")") == 0
+ if substitute(oline, '#.*', '', '') =~ g:r_indent_op_pattern && s:Get_paren_balance(line, "(", ")") == 0
return indent(lnum)
else
return indent(lnum) + shiftwidth()
endif
else
- if oline =~ g:r_indent_op_pattern && s:Get_paren_balance(line, "(", ")") == 0
+ if substitute(oline, '#.*', '', '') =~ g:r_indent_op_pattern && s:Get_paren_balance(line, "(", ")") == 0
return indent(lnum) - shiftwidth()
endif
endif
+ elseif substitute(line, '#.*', '', '') =~ g:r_indent_op_pattern && s:Get_paren_balance(line, "(", ")") == 0
+ return indent(lnum) + shiftwidth()
endif
let post_fun = 0
diff --git a/runtime/indent/rhelp.vim b/runtime/indent/rhelp.vim
index cf69ae3392..2b9d49b915 100644
--- a/runtime/indent/rhelp.vim
+++ b/runtime/indent/rhelp.vim
@@ -2,7 +2,7 @@
" Language: R Documentation (Help), *.Rd
" Author: Jakson Alves de Aquino <jalvesaq@gmail.com>
" Homepage: https://github.com/jalvesaq/R-Vim-runtime
-" Last Change: Tue Apr 07, 2015 04:38PM
+" Last Change: Feb 25, 2023
" Only load this indent file when no other was loaded.
@@ -20,6 +20,8 @@ setlocal nolisp
setlocal indentkeys=0{,0},:,!^F,o,O,e
setlocal indentexpr=GetCorrectRHelpIndent()
+let b:undo_indent = "setl ai< cin< inde< indk< lisp< si<"
+
" Only define the functions once.
if exists("*GetRHelpIndent")
finish
diff --git a/runtime/indent/rmd.vim b/runtime/indent/rmd.vim
index 8fd57257fa..a043b0c994 100644
--- a/runtime/indent/rmd.vim
+++ b/runtime/indent/rmd.vim
@@ -2,7 +2,7 @@
" Language: Rmd
" Author: Jakson Alves de Aquino <jalvesaq@gmail.com>
" Homepage: https://github.com/jalvesaq/R-Vim-runtime
-" Last Change: Sun Mar 28, 2021 08:05PM
+" Last Change: Wed Nov 09, 2022 09:44PM
" Only load this indent file when no other was loaded.
@@ -16,6 +16,8 @@ let b:did_indent = 1
setlocal indentkeys=0{,0},<:>,!^F,o,O,e
setlocal indentexpr=GetRmdIndent()
+let b:undo_indent = "setl inde< indk<"
+
if exists("*GetRmdIndent")
finish
endif
@@ -47,6 +49,8 @@ function s:GetMdIndent()
return indent(v:lnum - 1) + 2
elseif pline =~ '^\s*\d\+\.\s\+'
return indent(v:lnum - 1) + 3
+ elseif pline =~ '^\[\^\S\+\]: '
+ return indent(v:lnum - 1) + shiftwidth()
endif
return indent(prevnonblank(v:lnum - 1))
endfunction
diff --git a/runtime/indent/rnoweb.vim b/runtime/indent/rnoweb.vim
index 73966868b8..33bc103d18 100644
--- a/runtime/indent/rnoweb.vim
+++ b/runtime/indent/rnoweb.vim
@@ -2,7 +2,7 @@
" Language: Rnoweb
" Author: Jakson Alves de Aquino <jalvesaq@gmail.com>
" Homepage: https://github.com/jalvesaq/R-Vim-runtime
-" Last Change: Fri Apr 15, 2016 10:58PM
+" Last Change: Feb 25, 2023
" Only load this indent file when no other was loaded.
@@ -29,6 +29,8 @@ let b:did_indent = 1
setlocal indentkeys=0{,0},!^F,o,O,e,},=\bibitem,=\item
setlocal indentexpr=GetRnowebIndent()
+let b:undo_indent = "setl inde< indk<"
+
if exists("*GetRnowebIndent")
finish
endif
diff --git a/runtime/indent/rrst.vim b/runtime/indent/rrst.vim
index f3ee53e7fb..585c5e6654 100644
--- a/runtime/indent/rrst.vim
+++ b/runtime/indent/rrst.vim
@@ -2,7 +2,7 @@
" Language: Rrst
" Author: Jakson Alves de Aquino <jalvesaq@gmail.com>
" Homepage: https://github.com/jalvesaq/R-Vim-runtime
-" Last Change: Tue Apr 07, 2015 04:38PM
+" Last Change: Feb 25, 2023
" Only load this indent file when no other was loaded.
@@ -16,6 +16,8 @@ let b:did_indent = 1
setlocal indentkeys=0{,0},:,!^F,o,O,e
setlocal indentexpr=GetRrstIndent()
+let b:undo_indent = "setl inde< indk<"
+
if exists("*GetRrstIndent")
finish
endif