0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

Update runtime files

This commit is contained in:
Bram Moolenaar
2020-05-12 22:49:12 +02:00
parent 9e6ba8cbef
commit 47e13953ff
55 changed files with 577 additions and 2380 deletions

View File

@@ -28,6 +28,11 @@ set cpo&vim
let s:maxoff = 50 " maximum number of lines to look backwards for ()
" See if the specified line is already user-dedented from the expected value.
function s:Dedented(lnum, expected)
return indent(a:lnum) <= a:expected - shiftwidth()
endfunction
function GetPythonIndent(lnum)
" If this line is explicitly joined: If the previous line was also joined,
@@ -158,12 +163,12 @@ function GetPythonIndent(lnum)
" If the previous line was a stop-execution statement...
if getline(plnum) =~ '^\s*\(break\|continue\|raise\|return\|pass\)\>'
" See if the user has already dedented
if indent(a:lnum) > indent(plnum) - shiftwidth()
" If not, recommend one dedent
return indent(plnum) - shiftwidth()
if s:Dedented(a:lnum, indent(plnum))
" If so, trust the user
return -1
endif
" Otherwise, trust the user
return -1
" If not, recommend one dedent
return indent(plnum) - shiftwidth()
endif
" If the current line begins with a keyword that lines up with "try"
@@ -191,7 +196,7 @@ function GetPythonIndent(lnum)
endif
" Or the user has already dedented
if indent(a:lnum) <= plindent - shiftwidth()
if s:Dedented(a:lnum, plindent)
return -1
endif
@@ -203,7 +208,12 @@ function GetPythonIndent(lnum)
" + c)
" here
if parlnum > 0
return plindent
" ...unless the user has already dedented
if s:Dedented(a:lnum, plindent)
return -1
else
return plindent
endif
endif
return -1