view runtime/indent/gitconfig.vim @ 22192:9b5a90ad76c6 v8.2.1645

patch 8.2.1645: GTK3: icons become broken images when resized Commit: https://github.com/vim/vim/commit/81a4cf469a0f5c1603ac3130af9f011053854180 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Sep 9 19:05:13 2020 +0200 patch 8.2.1645: GTK3: icons become broken images when resized Problem: GTK3: icons become broken images when resized. Solution: Use gtk_image_new_from_icon_name(). (closes https://github.com/vim/vim/issues/6916) Fix compiler warnings.
author Bram Moolenaar <Bram@vim.org>
date Wed, 09 Sep 2020 19:15:03 +0200
parents 63b0b7b79b25
children
line wrap: on
line source

" Vim indent file
" Language:	git config file
" Maintainer:	Tim Pope <vimNOSPAM@tpope.org>
" Last Change:	2017 Jun 13

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

setlocal autoindent
setlocal indentexpr=GetGitconfigIndent()
setlocal indentkeys=o,O,*<Return>,0[,],0;,0#,=,!^F

let b:undo_indent = 'setl ai< inde< indk<'

" Only define the function once.
if exists("*GetGitconfigIndent")
  finish
endif

function! GetGitconfigIndent()
  let sw    = shiftwidth()
  let line  = getline(prevnonblank(v:lnum-1))
  let cline = getline(v:lnum)
  if line =~  '\\\@<!\%(\\\\\)*\\$'
    " odd number of slashes, in a line continuation
    return 2 * sw
  elseif cline =~ '^\s*\['
    return 0
  elseif cline =~ '^\s*\a'
    return sw
  elseif cline == ''       && line =~ '^\['
    return sw
  else
    return -1
  endif
endfunction