Skip to content

Commit

Permalink
Allow deleting character right after the prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
kovisoft committed Sep 30, 2019
1 parent a5ac819 commit c50c93f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
10 changes: 7 additions & 3 deletions ftplugin/slimv.vim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
" slimv.vim: The Superior Lisp Interaction Mode for VIM
" Version: 0.9.14
" Last Change: 01 Sep 2019
" Last Change: 30 Sep 2019
" Maintainer: Tamas Kovacs <kovisoft at gmail dot com>
" License: This file is placed in the public domain.
" No warranty, express or implied.
Expand Down Expand Up @@ -2089,8 +2089,12 @@ endfunction
" Handle insert mode 'Backspace' keypress in the REPL buffer
function! SlimvHandleBS()
if line( "." ) == s:GetPromptLine() && col( "." ) <= b:repl_prompt_col
" No BS allowed before the previous EOF mark
return ""
if col( "." ) == b:repl_prompt_col
return "\<BS> "
else
" No BS allowed before the previous EOF mark
return ""
endif
else
return "\<BS>"
endif
Expand Down
12 changes: 8 additions & 4 deletions plugin/paredit.vim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
" paredit.vim:
" Paredit mode for Slimv
" Version: 0.9.14
" Last Change: 20 Aug 2019
" Last Change: 30 Sep 2019
" Maintainer: Tamas Kovacs <kovisoft at gmail dot com>
" License: This file is placed in the public domain.
" No warranty, express or implied.
Expand Down Expand Up @@ -995,9 +995,13 @@ endfunction
function! PareditBackspace( repl_mode )
let [lp, cp] = s:GetReplPromptPos()
if a:repl_mode && line( "." ) == lp && col( "." ) <= cp
" No BS allowed before the previous EOF mark in the REPL
" i.e. don't delete Lisp prompt
return ""
if col( "." ) == cp
return "\<BS> "
else
" No BS allowed before the previous EOF mark in the REPL
" i.e. don't delete Lisp prompt
return ""
endif
endif

if !g:paredit_mode || s:InsideComment()
Expand Down

0 comments on commit c50c93f

Please sign in to comment.