-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #397 from lambdalisue/fix-syntax
Use `syntax/fern.vim` instead to define syntax/highlight
- Loading branch information
Showing
2 changed files
with
28 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
if exists('b:current_syntax') | ||
finish | ||
endif | ||
let b:current_syntax = 'fern' | ||
|
||
syntax clear | ||
|
||
function! s:ColorScheme() abort | ||
let helper = fern#helper#new() | ||
call helper.fern.renderer.highlight() | ||
call fern#hook#emit('viewer:highlight', helper) | ||
doautocmd <nomodeline> User FernHighlight | ||
endfunction | ||
|
||
function! s:Syntax() abort | ||
let helper = fern#helper#new() | ||
call helper.fern.renderer.syntax() | ||
call fern#hook#emit('viewer:syntax', helper) | ||
doautocmd <nomodeline> User FernSyntax | ||
endfunction | ||
|
||
augroup fern_syntax_internal | ||
autocmd! * <buffer> | ||
autocmd ColorScheme <buffer> call s:ColorScheme() | ||
augroup END | ||
|
||
call s:ColorScheme() | ||
call s:Syntax() |