mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
vim-patch:47e13953ffdb
Update runtime files
47e13953ff
Ignore *.rej files, generated by vim-patch.sh.
Source of mistakes for 1st-time contributors.
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user