From 186fced561737a894c968a9f2c45812a46c55535 Mon Sep 17 00:00:00 2001 From: w0rp Date: Mon, 23 Oct 2023 09:17:53 +0100 Subject: [PATCH] Add CSS prompt editing --- autoload/neural/pre_process/css.vim | 6 ++++++ test/vim/pre_process/test_css.vader | 12 ++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 autoload/neural/pre_process/css.vim create mode 100644 test/vim/pre_process/test_css.vader diff --git a/autoload/neural/pre_process/css.vim b/autoload/neural/pre_process/css.vim new file mode 100644 index 0000000..1cd6fe1 --- /dev/null +++ b/autoload/neural/pre_process/css.vim @@ -0,0 +1,6 @@ +" Author: w0rp +" Description: Pre-processing rules for CSS files. + +function! neural#pre_process#css#Process(buffer, input) abort + let a:input.prompt = 'Write CSS code. ' . a:input.prompt +endfunction diff --git a/test/vim/pre_process/test_css.vader b/test/vim/pre_process/test_css.vader new file mode 100644 index 0000000..34a6b0a --- /dev/null +++ b/test/vim/pre_process/test_css.vader @@ -0,0 +1,12 @@ +Before: + let g:input = {'prompt': 'Do something.'} + call neural#config#Load() + +After: + unlet! g:input + +Given css(An empty CSS file): +Execute(Basic CSS prompt editing should be done): + call neural#PreProcess(bufnr(''), g:input) + + AssertEqual 'Write CSS code. Do something.', g:input.prompt