view runtime/indent/readline.vim @ 10503:e0ad6123213c v8.0.0144

commit https://github.com/vim/vim/commit/9269315f635e44a340389be7e986782b98499311 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jan 6 14:55:36 2017 +0100 patch 8.0.0144: when using MSVC the GvimExt directory is cleaned twice Problem: When using MSVC the GvimExt directory is cleaned twice. Solution: Remove the lines. (Ken Takata)
author Christian Brabandt <cb@256bit.org>
date Fri, 06 Jan 2017 15:00:04 +0100
parents 5eb1ac6f92ad
children 1218c5353e2b
line wrap: on
line source

" Vim indent file
" Language:         readline configuration file
" Maintainer:       Nikolai Weibull <now@bitwi.se>
" Latest Revision:  2006-12-20

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

setlocal indentexpr=GetReadlineIndent()
setlocal indentkeys=!^F,o,O,=$else,=$endif
setlocal nosmartindent

if exists("*GetReadlineIndent")
  finish
endif

function GetReadlineIndent()
  let lnum = prevnonblank(v:lnum - 1)
  if lnum == 0
    return 0
  endif

  let ind = indent(lnum)

  if getline(lnum) =~ '^\s*$\(if\|else\)\>'
    let ind = ind + &sw
  endif

  if getline(v:lnum) =~ '^\s*$\(else\|endif\)\>'
    let ind = ind - &sw
  endif

  return ind
endfunction