From 1adc5f080bd13d808cd05ed5211e111e5a2235a4 Mon Sep 17 00:00:00 2001 From: Justin Frank Date: Fri, 24 May 2019 09:41:05 -0700 Subject: [PATCH] Added wip markdown code lazy-loading hook --- rc/filetype/markdown.kak | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rc/filetype/markdown.kak b/rc/filetype/markdown.kak index ab380b7fa..5b4563933 100644 --- a/rc/filetype/markdown.kak +++ b/rc/filetype/markdown.kak @@ -16,6 +16,11 @@ hook global WinSetOption filetype=markdown %{ hook window InsertChar \n -group markdown-indent markdown-indent-on-new-line hook -once -always window WinSetOption filetype=.* %{ remove-hooks window markdown-.+ } + + hook -group markdown-load buffer NormalIdle .* %{ try %{ evaluate-commands -draft %{ + execute-keys '%s^\h*```\h*\K[^\n]+$' + evaluate-commands -itersel %{ require-module %val{selection} } + }}} } hook -group markdown-highlight global WinSetOption filetype=markdown %{