view runtime/indent/xf86conf.vim @ 32738:05188ca69e43 v9.0.1688

patch 9.0.1688: cannot store custom data in quickfix list Commit: https://github.com/vim/vim/commit/ca6ac99077d2e6d020a34267aa5e0fbc4d23dc38 Author: Tom Praschan <13141438+tom-anders@users.noreply.github.com> Date: Fri Aug 11 23:26:12 2023 +0200 patch 9.0.1688: cannot store custom data in quickfix list Problem: cannot store custom data in quickfix list Solution: add `user_data` field for the quickfix list closes: #11818 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Tom Praschan <13141438+tom-anders@users.noreply.github.com>
author Christian Brabandt <cb@256bit.org>
date Fri, 11 Aug 2023 23:30:05 +0200
parents 4d76b3e07c07
children
line wrap: on
line source

" Vim indent file
" Language:		XFree86 Configuration File
" Maintainer:		Doug Kearns <dougkearns@gmail.com>
" Previous Maintainer:	Nikolai Weibull <now@bitwi.se>
" Last Change:		2022 April 25

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

setlocal indentexpr=GetXF86ConfIndent()
setlocal indentkeys=!^F,o,O,=End
setlocal nosmartindent

let b:undo_indent = "setl inde< indk< si<"

if exists("*GetXF86ConfIndent")
  finish
endif

function GetXF86ConfIndent()
  let lnum = prevnonblank(v:lnum - 1)

  if lnum == 0
    return 0
  endif

  let ind = indent(lnum)

  if getline(lnum) =~? '^\s*\(Sub\)\=Section\>'
    let ind = ind + shiftwidth()
  endif

  if getline(v:lnum) =~? '^\s*End\(Sub\)\=Section\>'
    let ind = ind - shiftwidth()
  endif

  return ind
endfunction