aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-04-11 18:22:41 +0800
committerzeertzjq <zeertzjq@outlook.com>2024-04-11 18:22:57 +0800
commitd2d4ad4b32d6444cb50677ce75342273632a44fc (patch)
tree20064fef2ea8f24c8ba416011b3d542b4de6a943
parent245745f9f0d2efe261970c711d80ee0727983b59 (diff)
downloadrneovim-d2d4ad4b32d6444cb50677ce75342273632a44fc.tar.gz
rneovim-d2d4ad4b32d6444cb50677ce75342273632a44fc.tar.bz2
rneovim-d2d4ad4b32d6444cb50677ce75342273632a44fc.zip
vim-patch:27f17a6d3493
runtime(asm): add basic indent support closes: vim/vim#14383 https://github.com/vim/vim/commit/27f17a6d3493f611f5bdc376217535f9c49b479b Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
-rw-r--r--runtime/indent/asm.vim28
1 files changed, 28 insertions, 0 deletions
diff --git a/runtime/indent/asm.vim b/runtime/indent/asm.vim
new file mode 100644
index 0000000000..7f848c7b5f
--- /dev/null
+++ b/runtime/indent/asm.vim
@@ -0,0 +1,28 @@
+" Vim indent file
+" Language: asm
+" Maintainer: Philip Jones <philj56@gmail.com>
+" Upstream: https://github.com/philj56/vim-asm-indent
+" Latest Revision: 2017-07-01
+
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+
+setlocal indentexpr=s:getAsmIndent()
+setlocal indentkeys=<:>,!^F,o,O
+
+let b:undo_ftplugin .= "indentexpr< indentkeys<"
+
+function! s:getAsmIndent()
+ let line = getline(v:lnum)
+ let ind = shiftwidth()
+
+ " If the line is a label (starts with ':' terminated keyword),
+ " then don't indent
+ if line =~ '^\s*\k\+:'
+ let ind = 0
+ endif
+
+ return ind
+endfunction