annotate runtime/indent.vim @ 31435:8fe720031437 v9.0.1050

patch 9.0.1050: using freed memory when assigning to variable twice Commit: https://github.com/vim/vim/commit/6342e2c5a6570231aefabd8e34c2f2cb22f6927a Author: Bram Moolenaar <Bram@vim.org> Date: Mon Dec 12 18:56:32 2022 +0000 patch 9.0.1050: using freed memory when assigning to variable twice Problem: Using freed memory when assigning to variable twice. Solution: Make copy of the list type. (closes https://github.com/vim/vim/issues/11691)
author Bram Moolenaar <Bram@vim.org>
date Mon, 12 Dec 2022 20:00:04 +0100
parents 9fe2fed9bb4b
children 4027cefc2aab
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim support file to switch on loading indent files for file types
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Maintainer: Bram Moolenaar <Bram@vim.org>
27634
9fe2fed9bb4b Update runtime files. (closes #9741)
Bram Moolenaar <Bram@vim.org>
parents: 27538
diff changeset
4 " Last Change: 2022 Feb 11
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 if exists("did_indent_on")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 let did_indent_on = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 augroup filetypeindent
233
fca8a9b65afa updated for version 7.0065
vimboss
parents: 7
diff changeset
12 au FileType * call s:LoadIndent()
27538
f37561549ec2 Update runtime files; use compiled functions
Bram Moolenaar <Bram@vim.org>
parents: 1549
diff changeset
13 augroup END
f37561549ec2 Update runtime files; use compiled functions
Bram Moolenaar <Bram@vim.org>
parents: 1549
diff changeset
14
f37561549ec2 Update runtime files; use compiled functions
Bram Moolenaar <Bram@vim.org>
parents: 1549
diff changeset
15 def s:LoadIndent()
f37561549ec2 Update runtime files; use compiled functions
Bram Moolenaar <Bram@vim.org>
parents: 1549
diff changeset
16 if exists("b:undo_indent")
27634
9fe2fed9bb4b Update runtime files. (closes #9741)
Bram Moolenaar <Bram@vim.org>
parents: 27538
diff changeset
17 legacy exe b:undo_indent
27538
f37561549ec2 Update runtime files; use compiled functions
Bram Moolenaar <Bram@vim.org>
parents: 1549
diff changeset
18 unlet! b:undo_indent b:did_indent
f37561549ec2 Update runtime files; use compiled functions
Bram Moolenaar <Bram@vim.org>
parents: 1549
diff changeset
19 endif
f37561549ec2 Update runtime files; use compiled functions
Bram Moolenaar <Bram@vim.org>
parents: 1549
diff changeset
20 var s = expand("<amatch>")
f37561549ec2 Update runtime files; use compiled functions
Bram Moolenaar <Bram@vim.org>
parents: 1549
diff changeset
21 if s != ""
f37561549ec2 Update runtime files; use compiled functions
Bram Moolenaar <Bram@vim.org>
parents: 1549
diff changeset
22 if exists("b:did_indent")
f37561549ec2 Update runtime files; use compiled functions
Bram Moolenaar <Bram@vim.org>
parents: 1549
diff changeset
23 unlet b:did_indent
233
fca8a9b65afa updated for version 7.0065
vimboss
parents: 7
diff changeset
24 endif
1549
19ef2bbf569c updated for version 7.1-263
vimboss
parents: 233
diff changeset
25
27538
f37561549ec2 Update runtime files; use compiled functions
Bram Moolenaar <Bram@vim.org>
parents: 1549
diff changeset
26 # When there is a dot it is used to separate filetype names. Thus for
f37561549ec2 Update runtime files; use compiled functions
Bram Moolenaar <Bram@vim.org>
parents: 1549
diff changeset
27 # "aaa.bbb" load "indent/aaa.vim" and then "indent/bbb.vim".
f37561549ec2 Update runtime files; use compiled functions
Bram Moolenaar <Bram@vim.org>
parents: 1549
diff changeset
28 for name in split(s, '\.')
f37561549ec2 Update runtime files; use compiled functions
Bram Moolenaar <Bram@vim.org>
parents: 1549
diff changeset
29 exe 'runtime! indent/' .. name .. '.vim'
f37561549ec2 Update runtime files; use compiled functions
Bram Moolenaar <Bram@vim.org>
parents: 1549
diff changeset
30 endfor
f37561549ec2 Update runtime files; use compiled functions
Bram Moolenaar <Bram@vim.org>
parents: 1549
diff changeset
31 endif
f37561549ec2 Update runtime files; use compiled functions
Bram Moolenaar <Bram@vim.org>
parents: 1549
diff changeset
32 enddef