Skip to content

Commit

Permalink
Add prompt editing for C++
Browse files Browse the repository at this point in the history
  • Loading branch information
w0rp committed Sep 5, 2023
1 parent 284b460 commit 05b59bc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
7 changes: 7 additions & 0 deletions autoload/neural/pre_process/cpp.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
" Author: w0rp <devw0rp@gmail.com>
" Description: Pre-processing rules for C++ files.

function! neural#pre_process#cpp#Process(buffer, input) abort
let a:input.prompt = 'Write C++ syntax. '
\ . a:input.prompt
endfunction
12 changes: 12 additions & 0 deletions test/vim/pre_process/test_cpp.vader
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Before:
let g:input = {'prompt': 'Do something.'}
call neural#config#Load()

After:
unlet! g:input

Given cpp(An empty C++ file):
Execute(Basic C++ prompt editing should be done):
call neural#PreProcess(bufnr(''), g:input)

AssertEqual 'Write C++ syntax. Do something.', g:input.prompt

0 comments on commit 05b59bc

Please sign in to comment.