Mercurial > vim
view runtime/indent/postscr.vim @ 11510:deb9295dccda v8.0.0638
patch 8.0.0638: cannot build with new MSVC version
commit https://github.com/vim/vim/commit/d7383881c8e9f474a909b54b21abb0aa2b412ba2
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jun 13 15:22:12 2017 +0200
patch 8.0.0638: cannot build with new MSVC version
Problem: Cannot build with new MSVC version VS2017.
Solution: Change the compiler arguments. (Leonardo Manera, closes https://github.com/vim/vim/issues/1731,
closes #1747)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 13 Jun 2017 15:30:03 +0200 |
parents | 3fc0f57ecb91 |
children | 63b0b7b79b25 |
line wrap: on
line source
" PostScript indent file " Language: PostScript " Maintainer: Mike Williams <mrw@netcomuk.co.uk> " Last Change: 2nd July 2001 " " Only load this indent file when no other was loaded. if exists("b:did_indent") finish endif let b:did_indent = 1 setlocal indentexpr=PostscrIndentGet(v:lnum) setlocal indentkeys+=0],0=>>,0=%%,0=end,0=restore,0=grestore indentkeys-=:,0#,e " Catch multiple instantiations if exists("*PostscrIndentGet") finish endif function! PostscrIndentGet(lnum) " Find a non-empty non-comment line above the current line. " Note: ignores DSC comments as well! let lnum = a:lnum - 1 while lnum != 0 let lnum = prevnonblank(lnum) if getline(lnum) !~ '^\s*%.*$' break endif let lnum = lnum - 1 endwhile " Hit the start of the file, use user indent. if lnum == 0 return -1 endif " Start with the indent of the previous line let ind = indent(lnum) let pline = getline(lnum) " Indent for dicts, arrays, and saves with possible trailing comment if pline =~ '\(begin\|<<\|g\=save\|{\|[\)\s*\(%.*\)\=$' let ind = ind + &sw endif " Remove indent for popped dicts, and restores. if pline =~ '\(end\|g\=restore\)\s*$' let ind = ind - &sw " Else handle immediate dedents of dicts, restores, and arrays. elseif getline(a:lnum) =~ '\(end\|>>\|g\=restore\|}\|]\)' let ind = ind - &sw " Else handle DSC comments - always start of line. elseif getline(a:lnum) =~ '^\s*%%' let ind = 0 endif " For now catch excessive left indents if they occur. if ind < 0 let ind = -1 endif return ind endfunction " vim:sw=2