Skip to content

Commit

Permalink
Added folding at [iscript], [macro].
Browse files Browse the repository at this point in the history
  • Loading branch information
popkirby committed Mar 12, 2012
1 parent 2b65318 commit 578a0b2
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 9 deletions.
28 changes: 23 additions & 5 deletions doc/kag3.jax
@@ -1,7 +1,7 @@
*kag3.txt*

Author: popkirby <popkirby@gmail.com>
Version: 0.0.0
Version: 0.0.1
License: MIT license {{{
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand All @@ -24,10 +24,12 @@ License: MIT license {{{

目次 *kag3-syntax-contents*

概要 |kag3-syntax-introduction|
インストール |kag3-syntax-install|
TODO |kag3-syntax-todo|
変更履歴 |kag3-syntax-changelog|
概要 |kag3-syntax-introduction|
インストール |kag3-syntax-install|
インターフェース |kag3-syntax-interface|
- 変数 |kag3-syntax-variables|
TODO |kag3-syntax-todo|
変更履歴 |kag3-syntax-changelog|

==============================================================================
概要 *kag3-syntax-introdunction*
Expand All @@ -39,6 +41,18 @@ TODO |kag3-syntax-todo|

配布ファイルをVimスクリプトのディレクトリへインストールしてください。

==============================================================================
インターフェース *kag3-syntax-interface*
------------------------------------------------------------------------------
変数 *kag3-syntax-variables*

g:use_kag3_syntax_folding *g:use_kag3_syntax_folding*
シンタックスファイルによる iscript タグ、 macro タグ間の折りた
たみを利用するかどうかを指定する。
1ならば利用するが、0ならば利用しない。

既定値は1である。

==============================================================================
TODO *kag3-syntax-todo*

Expand All @@ -48,6 +62,10 @@ TODO *kag3-syntax-todo*
==============================================================================
変更履歴 *kag3-syntax-changelog*

0.0.1:
- iscript タグ間を TJS2 でハイライトするように
- iscript 、 macro タグ間を折り畳むように

0.0.0:
- Initial upload

Expand Down
19 changes: 15 additions & 4 deletions syntax/kag3.vim
@@ -1,12 +1,11 @@
" Vim syntax file
" Language: KAG3
" Maintainer: popkirby <popkirby@gmail.com>
" Last Change: 2012 Mar 3
" Last Change: 2012 Mar 12
" Remark: Include TJS syntax.
" Changes: First submission.
" Changes: Added folding at [iscript], [macro].
"
" TODO:
" - Add TJS syntax at [iscript] ~ [endscript].

if !exists("main_syntax")
if version < 600
Expand All @@ -18,6 +17,7 @@ if !exists("main_syntax")
endif



syntax sync fromstart
syntax case match

Expand Down Expand Up @@ -55,13 +55,24 @@ syntax keyword kag3Boolean true false contained
" Include TJS2 syntax.
if globpath(&rtp, 'syntax/tjs2.vim') != ''
syntax include @kag3Tjs2Top syntax/tjs2.vim
syntax region kag3Tjs2Script start="\[iscript\]"ms=s+9 end="\[endscript\]"me=s-1 keepend contains=@kag3Tjs2Top,kag3Tjs2ScriptTag
syntax region kag3Tjs2Script start="\[iscript\]"rs=s+9 end="\[endscript\]"me=s-1 keepend contains=@kag3Tjs2Top,kag3Tjs2ScriptTag
syntax region kag3Tjs2Script start="^@iscript"rs=s+8 end="^@endscript"me=s-1 keepend contains=@kag3Tjs2Top,kag3Tjs2ScriptTag
syntax region kag3Tjs2ScriptTag start="\[\(iscript\]\)\@=" end="\]" oneline contained contains=kag3Tjs2ScriptTagName
syntax region kag3Tjs2ScriptTag start="@\(iscript\)\@=" end="$" contained contains=kag3Tjs2ScriptTagName
syntax match kag3Tjs2ScriptTagName "iscript" contained
endif

" Folding
let g:use_kag3_syntax_folding = get(g:, 'use_kag3_syntax_folding', 1)
if g:use_kag3_syntax_folding == 1
syntax region kag3Tjs2ScriptFold1 start="\[iscript\]" end="\[endscript\]" transparent fold keepend
syntax region kag3Tjs2ScriptFold2 start="^@iscript" end="^@endscript" transparent fold keepend
syntax region kag3MacroFold1 start="\[macro" end="\[endmacro\]" transparent fold keepend
syntax region kag3MacroFold2 start="^@macro" end="^@endmacro" transparent fold keepend
set foldmethod=syntax
endif


" Define highlighting
if version >= 508 || !exists("did_kag3_syn_inits")
if version < 508
Expand Down

0 comments on commit 578a0b2

Please sign in to comment.