view runtime/indent/asm.vim @ 35188:965c65610164 default tip

Added tag v9.1.0414 for changeset de9a4c63e943711d1cd7e9ac50fb0baf4cbbf33c
author Christian Brabandt <cb@256bit.org>
date Thu, 16 May 2024 21:00:48 +0200
parents 43739470fe40
children
line wrap: on
line source

" Vim indent file
" Language:	asm
" Maintainer:	Philip Jones <philj56@gmail.com>
" Upstream:	https://github.com/philj56/vim-asm-indent
" Last Change:	2017-Jul-01
"		2024 Apr 25 by Vim Project (undo_indent)

if exists("b:did_indent")
  finish
endif
let b:did_indent = 1

setlocal indentexpr=s:getAsmIndent()
setlocal indentkeys=<:>,!^F,o,O

let b:undo_indent = "setlocal 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