view runtime/indent/rnoweb.vim @ 32309:d245cd5b3bd7 v9.0.1486

patch 9.0.1486: parallel make might not work Commit: https://github.com/vim/vim/commit/cfc788c38848adcd54e4130f16f2813cd1e215dd Author: Samuel Dionne-Riel <samuel@dionne-riel.com> Date: Mon Apr 24 22:41:53 2023 +0100 patch 9.0.1486: parallel make might not work Problem: Parallel make might not work. Solution: Add missing dependencies. (Samuel Dionne-Riel, closes https://github.com/vim/vim/issues/12288)
author Bram Moolenaar <Bram@vim.org>
date Mon, 24 Apr 2023 23:45:02 +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