aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2020-04-17 08:55:55 +0200
committerMartin Liska <mliska@suse.cz>2020-04-17 08:55:55 +0200
commit5315e1dafa08a57b757d02fe65baea65f0550c41 (patch)
tree5f4ea61d52229d532eccfeee4758c282cfe04a8b /contrib
parentdd75498db79675a1a0b73c25e5f110969ee72d9d (diff)
downloadgcc-5315e1dafa08a57b757d02fe65baea65f0550c41.zip
gcc-5315e1dafa08a57b757d02fe65baea65f0550c41.tar.gz
gcc-5315e1dafa08a57b757d02fe65baea65f0550c41.tar.bz2
Do not modify tab options in vimrc for .py files.
* vimrc: We do not want to modify tab options for Python files.
Diffstat (limited to 'contrib')
-rw-r--r--contrib/ChangeLog5
-rw-r--r--contrib/vimrc14
2 files changed, 13 insertions, 6 deletions
diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index 7efe9a4..43fe1e7 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,8 @@
+2020-04-17 Martin Liska <mliska@suse.cz>
+
+ * vimrc: We do not want to modify tab options
+ for Python files.
+
2020-04-16 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/92008
diff --git a/contrib/vimrc b/contrib/vimrc
index bbbe1dd..fa0208d 100644
--- a/contrib/vimrc
+++ b/contrib/vimrc
@@ -28,17 +28,19 @@
function! SetStyle()
let l:fname = expand("%:p")
+ let l:ext = fnamemodify(l:fname, ":e")
+ let l:c_exts = ['c', 'h', 'cpp', 'cc', 'C', 'H', 'def', 'java']
if stridx(l:fname, 'libsanitizer') != -1
return
endif
- setlocal tabstop=8
- setlocal softtabstop=2
- setlocal shiftwidth=2
- setlocal noexpandtab
+ if l:ext != "py"
+ setlocal tabstop=8
+ setlocal softtabstop=2
+ setlocal shiftwidth=2
+ setlocal noexpandtab
+ endif
setlocal textwidth=80
setlocal formatoptions-=ro formatoptions+=cqlt
- let l:ext = fnamemodify(l:fname, ":e")
- let l:c_exts = ['c', 'h', 'cpp', 'cc', 'C', 'H', 'def', 'java']
if index(l:c_exts, l:ext) != -1
setlocal cindent
setlocal cinoptions=>4,n-2,{2,^-2,:2,=2,g0,f0,h2,p4,t0,+2,(0,u0,w1,m0