Skip to content

Commit

Permalink
Add basic prompt editing for Python
Browse files Browse the repository at this point in the history
  • Loading branch information
w0rp committed Sep 21, 2023
1 parent 07713e2 commit dc15c31
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/python.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
" Author: w0rp <[email protected]>
" Description: Pre-processing rules for Python

function! neural#pre_process#python#Process(buffer, input) abort
let a:input.prompt = 'Write Python syntax. '
\ . a:input.prompt
endfunction
12 changes: 12 additions & 0 deletions test/vim/pre_process/test_python.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 python(An empty Python file):
Execute(Basic Python prompt editing should be done):
call neural#PreProcess(bufnr(''), g:input)

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

0 comments on commit dc15c31

Please sign in to comment.