view runtime/indent/chatito.vim @ 32768:ad7365d54a0e v9.0.1702

patch 9.0.1702: Undo test is flaky Commit: https://github.com/vim/vim/commit/9c30f4389944810cf88154d25dfd9ea5737c19e6 Author: zeertzjq <zeertzjq@outlook.com> Date: Sun Aug 13 10:29:26 2023 +0200 patch 9.0.1702: Undo test is flaky Problem: Undo test is flaky. Solution: Apply filter and change time to "1 second ago" in both dumps. closes: #12771 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
author Christian Brabandt <cb@256bit.org>
date Sun, 13 Aug 2023 10:45:05 +0200
parents 1e91e26ceebf
children
line wrap: on
line source

" Vim indent file
" Language:	Chatito
" Maintainer:	ObserverOfTime <chronobserver@disroot.org>
" Last Change:	2022 Sep 20

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

setlocal indentexpr=GetChatitoIndent()
setlocal indentkeys=o,O,*<Return>,0#,!^F

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

if exists('*GetChatitoIndent')
    finish
endif

function GetChatitoIndent()
    let l:prev = v:lnum - 1
    if getline(prevnonblank(l:prev)) =~# '^[~%@]\['
        " shift indent after definitions
        return shiftwidth()
    elseif getline(l:prev) !~# '^\s*$'
        " maintain indent in sentences
        return indent(l:prev)
    else
        " reset indent after a blank line
        return 0
    end
endfunction