view runtime/indent/rnoweb.vim @ 32912:d5415aca2e3c v9.0.1764

patch 9.0.1764: CI: label should not be set on all yml files Commit: https://github.com/vim/vim/commit/4924ad099f6b40505ebbd1a4a4056e9915d70141 Author: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Sun Aug 20 18:58:46 2023 +0200 patch 9.0.1764: CI: label should not be set on all yml files Problem: CI: label should not be set on all yml files Solution: only set it for specific yml files in .github closes: #12855 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Philip H <47042125+pheiduck@users.noreply.github.com>
author Christian Brabandt <cb@256bit.org>
date Sun, 20 Aug 2023 19:15:03 +0200
parents b2e8663e6dcc
children 02bd0fe77c68
line wrap: on
line source

" Vim indent file
" Language:	Rnoweb
" Author:	Jakson Alves de Aquino <jalvesaq@gmail.com>
" Homepage:     https://github.com/jalvesaq/R-Vim-runtime
" Last Change:	Mon Feb 27, 2023  07:17PM


" Only load this indent file when no other was loaded.
if exists("b:did_indent")
  finish
endif
runtime indent/tex.vim

function s:NoTeXIndent()
  return indent(line("."))
endfunction

if &indentexpr == "" || &indentexpr == "GetRnowebIndent()"
  let s:TeXIndent = function("s:NoTeXIndent")
else
  let s:TeXIndent = function(substitute(&indentexpr, "()", "", ""))
endif

unlet! b:did_indent
runtime indent/r.vim
let s:RIndent = function(substitute(&indentexpr, "()", "", ""))
let b:did_indent = 1

setlocal indentkeys=0{,0},!^F,o,O,e,},=\bibitem,=\item
setlocal indentexpr=GetRnowebIndent()

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

if exists("*GetRnowebIndent")
  finish
endif

function GetRnowebIndent()
  let curline = getline(".")
  if curline =~ '^<<.*>>=$' || curline =~ '^\s*@$'
    return 0
  endif
  if search("^<<", "bncW") > search("^@", "bncW")
    return s:RIndent()
  endif
  return s:TeXIndent()
endfunction

" vim: sw=2