From 9f37d8ca3a6ce2d71c12cd82f25dcd2dadb3f1cd Mon Sep 17 00:00:00 2001 From: w0rp Date: Sun, 19 Nov 2023 10:41:18 +0000 Subject: [PATCH] Add a Lua file --- autoload/neural/pre_process/lua.vim | 7 +++++++ test/vim/pre_process/test_lua.vader | 12 ++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 autoload/neural/pre_process/lua.vim create mode 100644 test/vim/pre_process/test_lua.vader diff --git a/autoload/neural/pre_process/lua.vim b/autoload/neural/pre_process/lua.vim new file mode 100644 index 0000000..4058762 --- /dev/null +++ b/autoload/neural/pre_process/lua.vim @@ -0,0 +1,7 @@ +" Author: w0rp +" Description: Pre-processing rules for Lua files. + +function! neural#pre_process#lua#Process(buffer, input) abort + let a:input.prompt = 'Write Lua code. ' + \ . a:input.prompt +endfunction diff --git a/test/vim/pre_process/test_lua.vader b/test/vim/pre_process/test_lua.vader new file mode 100644 index 0000000..29e0f06 --- /dev/null +++ b/test/vim/pre_process/test_lua.vader @@ -0,0 +1,12 @@ +Before: + let g:input = {'prompt': 'Do something.'} + call neural#config#Load() + +After: + unlet! g:input + +Given lua(An empty Lua file): +Execute(Basic Lua prompt editing should be done): + call neural#PreProcess(bufnr(''), g:input) + + AssertEqual 'Write Lua code. Do something.', g:input.prompt