annotate runtime/ftplugin/bash.vim @ 17659:121bdff812b4 v8.1.1827

patch 8.1.1827: allocating more memory than needed for extended structs commit https://github.com/vim/vim/commit/47ed553fd5bebfc36eb8aa81686eeaa5a84eccac Author: Bram Moolenaar <Bram@vim.org> Date: Thu Aug 8 20:49:14 2019 +0200 patch 8.1.1827: allocating more memory than needed for extended structs Problem: Allocating more memory than needed for extended structs. Solution: Use offsetof() instead of sizeof(). (Dominique Pelle, closes #4786)
author Bram Moolenaar <Bram@vim.org>
date Thu, 08 Aug 2019 21:00:07 +0200
parents f0f06837a699
children 03b854983b14
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15512
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
1 " Vim filetype plugin file
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
2 " Language: bash
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
3 " Maintainer: Bram Moolenaar
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
4 " Last Changed: 2019 Jan 12
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
5 "
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
6 " This is not a real filetype plugin. It allows for someone to set 'filetype'
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
7 " to "bash" in the modeline, and gets the effect of filetype "sh" with
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
8 " b:is_bash set. Idea from Mahmode Al-Qudsi.
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
9
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
10 if exists("b:did_ftplugin")
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
11 finish
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
12 endif
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
13
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
14 let b:is_bash = 1
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
15 if exists("b:is_sh")
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
16 unlet b:is_sh
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
17 endif
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
18 if exists("b:is_kornshell")
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
19 unlet b:is_kornshell
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
20 endif
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
21
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
22 " Setting 'filetype' here directly won't work, since we are being invoked
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
23 " through an autocommand. Do it later, on the BufWinEnter event.
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
24 augroup bash_filetype
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
25 au BufWinEnter * call SetBashFt()
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
26 augroup END
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
27
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
28 func SetBashFt()
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
29 au! bash_filetype
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
30 set ft=sh
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
31 endfunc