Skip to content

Commit a70ee5a

Browse files
committed
Drop Vim 7.3
1 parent 5803853 commit a70ee5a

2 files changed

Lines changed: 8 additions & 16 deletions

File tree

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2015-2019 Akinori Hattori <hattya@gmail.com>
1+
Copyright (c) 2015-2020 Akinori Hattori <hattya@gmail.com>
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

indent/python.vim

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
" Vim indent file
22
" Language: Python
33
" Author: Akinori Hattori <hattya@gmail.com>
4-
" Last Change: 2019-03-17
4+
" Last Change: 2020-03-16
55
" License: MIT License
66

77
if exists('b:did_indent')
@@ -66,15 +66,15 @@ function! GetPEP8PythonIndent() abort
6666
let ind = indent(pos[0])
6767
if s:rbrkt() || getline(v:lnum) !~# '^\s*[]})]'
6868
if s:is_compound_stmt(l, 1)
69-
let ind += s:ml_stmt() || !s:is_compound_stmt(l) ? s:sw() * 2 : s:sw()
69+
let ind += s:ml_stmt() || !s:is_compound_stmt(l) ? shiftwidth() * 2 : shiftwidth()
7070
else
7171
let ind += s:cont()
7272
endif
7373
endif
7474
else
7575
let ind = strdisplaywidth(l[: pos[1] - 1])
7676
if s:ml_stmt() && s:is_compound_stmt(l)
77-
let ind += s:sw()
77+
let ind += shiftwidth()
7878
endif
7979
endif
8080
return ind
@@ -130,14 +130,14 @@ function! GetPEP8PythonIndent() abort
130130
let ll = join(buf, ' ')
131131
if ll =~# ':\s*\%(#.*\)\=$'
132132
" compound statement
133-
let ind += s:sw()
133+
let ind += shiftwidth()
134134
elseif ll =~# s:dedent
135135
" simple statement
136-
let ind -= s:sw()
136+
let ind -= shiftwidth()
137137
elseif getline(v:lnum - 1) =~# s:lcont
138138
" line continuation
139139
if s:is_compound_stmt(ll)
140-
let ind += s:ml_stmt() ? s:sw() * 2 : s:sw()
140+
let ind += s:ml_stmt() ? shiftwidth() * 2 : shiftwidth()
141141
else
142142
let ind += s:cont()
143143
endif
@@ -177,7 +177,7 @@ function! s:is_compound_stmt(str, ...) abort
177177
endfunction
178178

179179
function! s:cont() abort
180-
return eval(s:getvar('python_indent_continue', s:sw()))
180+
return eval(s:getvar('python_indent_continue', shiftwidth()))
181181
endfunction
182182

183183
function! s:rbrkt() abort
@@ -192,13 +192,5 @@ function! s:getvar(name, ...) abort
192192
return get(b:, a:name, get(g:, a:name, a:0 > 0 ? a:1 : 0))
193193
endfunction
194194

195-
if exists('*shiftwidth')
196-
let s:sw = function('shiftwidth')
197-
else
198-
function! s:sw()
199-
return &sw
200-
endfunction
201-
endif
202-
203195
let &cpo = s:save_cpo
204196
unlet s:save_cpo

0 commit comments

Comments
 (0)