Mercurial > vim
view runtime/indent/yacc.vim @ 18331:3e657635ca36 v8.1.2160
patch 8.1.2160: cannot build with +syntax but without +terminal
Commit: https://github.com/vim/vim/commit/a6cc5beb1705359828a45b91402c34640f4e756a
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Oct 16 18:42:26 2019 +0200
patch 8.1.2160: cannot build with +syntax but without +terminal
Problem: Cannot build with +syntax but without +terminal.
Solution: Add #ifdef.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 16 Oct 2019 18:45:04 +0200 |
parents | 1218c5353e2b |
children | 4d76b3e07c07 |
line wrap: on
line source
" Vim indent file " Language: YACC input file " Previous Maintainer: Nikolai Weibull <now@bitwi.se> " Latest Revision: 2006-12-20 " Only load this indent file when no other was loaded. if exists("b:did_indent") finish endif let b:did_indent = 1 setlocal indentexpr=GetYaccIndent() setlocal indentkeys=!^F,o,O setlocal nosmartindent " Only define the function once. if exists("*GetYaccIndent") finish endif function GetYaccIndent() if v:lnum == 1 return 0 endif let ind = indent(v:lnum - 1) let line = getline(v:lnum - 1) if line == '' let ind = 0 elseif line =~ '^\w\+\s*:' let ind = ind + matchend(line, '^\w\+\s*') elseif line =~ '^\s*;' let ind = 0 else let ind = indent(v:lnum) endif return ind endfunction