view runtime/indent/chatito.vim @ 31994:096fe1952003 v9.0.1329

patch 9.0.1329: completion of map includes simplified ones Commit: https://github.com/vim/vim/commit/997b8a015cd39141866e953651d55c705275cbd6 Author: zeertzjq <zeertzjq@outlook.com> Date: Sun Feb 19 21:00:31 2023 +0000 patch 9.0.1329: completion of map includes simplified ones Problem: Completion of map includes simplified ones. Solution: Do not complete simplified mappings. (closes https://github.com/vim/vim/issues/12013)
author Bram Moolenaar <Bram@vim.org>
date Sun, 19 Feb 2023 22:15:03 +0100
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