• R/O
  • HTTP
  • SSH
  • HTTPS

kink.vim: 提交

Vim Plugins for Kink Programming Language


Commit MetaInfo

修订版8393073b6eb12fc661bddac7b95f6698fe02af91 (tree)
时间2014-10-12 16:52:56
作者Miyakawa Taku <miyakawa.taku@gmai...>
CommiterMiyakawa Taku

Log Message

indentation for (*...*) and [*...*]

更改概述

差异

--- a/indent/kink.vim
+++ b/indent/kink.vim
@@ -1,9 +1,9 @@
11 " Vim indent file for Kink
22 " Language: Kink (http://code.google.com/p/kink-lang/)
33 " Maintainer: Miyakawa Taku <miyakawa.taku@gmail.com>
4-" Last Change: 2013-06-13
4+" Last Change: 2014-10-12
55
6-" Copyright (c) 2013 Miyakawa Taku
6+" Copyright (c) 2014 Miyakawa Taku
77 "
88 " Permission is hereby granted, free of charge, to any person obtaining a copy
99 " of this software and associated documentation files (the "Software"), to deal
@@ -34,7 +34,7 @@ setlocal nolisp
3434 setlocal autoindent
3535
3636 setlocal indentexpr=GetKinkIndent(v:lnum)
37-setlocal indentkeys=0},0),0=],!^F,o,O
37+setlocal indentkeys=0},0),0=],0=*),0=*],!^F,o,O
3838
3939 " Defines the function only once.
4040 if exists("*GetKinkIndent")
@@ -62,8 +62,8 @@ function! GetKinkIndent(line_number)
6262
6363 " Closing a paren/brace/brancket?
6464 let cur_line = getline(a:line_number)
65- if cur_line =~ '^\s*\(}\|]\|)\)'
66- let opening_pattern = (cur_line =~ '^\s*}' ? '{' : cur_line =~ '^\s*]' ? '\[' : '(')
65+ if cur_line =~ '^\s*\(}\|\*\?]\|\*\?)\)'
66+ let opening_pattern = (cur_line =~ '^\s*}' ? '{' : cur_line =~ '^\s*\*\?]' ? '\[' : '(')
6767 let closing_pattern = (opening_pattern == '{' ? '}' : opening_pattern == '\[' ? ']' : ')')
6868 call cursor(a:line_number, 1)
6969 let open_line_number = searchpair(opening_pattern, '', closing_pattern, 'bnW', skip)
Show on old repository browser