Commits

Tamas Kovacs  committed 2dcdc99

Removed ' prefix from SlimvSelectSymbol(), added SlimvSelectSymbolExt() for Inspect, keep cursor positon in SlimvCommandUsePackage() and SlimvCompileRegion()

  • Participants
  • Parent commits 3be5642
  • Tags 0.8.1

Comments (0)

Files changed (3)

 Script versions
 --------------------------------------------------------------------------------
 
+0.8.1: Added action handling to Inspector, fixed Inspector output, bugfixes: read-string mode was stuck, buffer corruption with two source windows (thanks to Philipp Marek), eliminate multiple CursorHold autocommands (thanks to Philipp Marek), completion with special characters in symbol name (thanks to Philipp Marek), sometimes cursor went to the start of line in insert mode, syntax error in Untrace All (thanks to Philipp Marek), removed ' prefix from symbol selection (except for Inspect), keep cursor position in Describe and Compile-Region.
+
 0.8.0: Major update: added SWANK client (many thanks to Philipp Marek), additional changes: split documentation into three parts, added keymapping hints to GUI menu items, renamed Eval-Last-Expression to Eval-Current-Expression, REPL buffer is not syntax highlighted anymore, switch on filetype plugins, autodetection for Allegro CL, Lisp Cabinet and Leiningen, ask for save before compiling file, map <Tab> for completion, bugfixes: finding start of keyword in completion, deleting escaped " inside string, Up/Down/Enter handling in popup menu.
 
 0.7.7: Find next closing paren when using ,< or ,> in Paredit and not standing on a paren, open REPL buffer upon connecting server, bugfixes: REPL buffer prompt identification was sometimes missing, switch off REPL refresh mode when REPL buffer is not visible (thanks to Philipp Marek), convert Python path on Windows to short 8.3 filename format if it contains space (thanks to Razvan Rotaru).

File doc/slimv.txt

-*slimv.txt*                    Slimv                 Last Change: 19 Apr 2011
+*slimv.txt*                    Slimv                 Last Change: 20 Apr 2011
 
 Slimv                                                                  *slimv*
                                Version 0.8.1
 ===============================================================================
 CHANGE LOG                                                    *slimv-changelog*
 
-0.8.1  - Added action handling to inspector.
+0.8.1  - Added action handling to Inspector, fixed Inspector output.
        - Bugfix: read-string mode was stuck.
        - Bugfix: buffer corruption with two source windows
          (thanks to Philipp Marek).
        - Bugfix: completion with special characters in symbol name
          (thanks to Philipp Marek).
        - Bugfix: sometimes cursor went to the start of line in insert mode.
-       - Bugfix: syntax error in Untrace All.
+       - Bugfix: syntax error in Untrace All (thanks to Philipp Marek).
+       - Bugfix: removed ' prefix from symbol selection (except for Inspect).
+       - Bugfix: keep cursor position in Describe and Compile-Region.
 
 0.8.0  - Major update: added SWANK client (many thanks to Philipp Marek).
        - Split documentation into three parts.

File ftplugin/slimv.vim

 " slimv.vim:    The Superior Lisp Interaction Mode for VIM
 " Version:      0.8.1
-" Last Change:  19 Apr 2011
+" Last Change:  20 Apr 2011
 " Maintainer:   Tamas Kovacs <kovisoft at gmail dot com>
 " License:      This file is placed in the public domain.
 "               No warranty, express or implied.
 
 " Select symbol under cursor and return it
 function! SlimvSelectSymbol()
+    if SlimvGetFiletype() == 'clojure'
+        setlocal iskeyword+=~,#,&,\|,{,},!,?
+    else
+        setlocal iskeyword+=~,#,&,\|,{,},[,],!,?
+    endif
+    let symbol = expand('<cword>')
+    return symbol
+endfunction
+
+" Select symbol with possible prefixes under cursor and return it
+function! SlimvSelectSymbolExt()
     let save_iskeyword = &iskeyword
     if SlimvGetFiletype() == 'clojure'
         setlocal iskeyword+=~,#,&,\|,{,},!,?,'
 
 " Execute the given SWANK command with current package defined
 function! SlimvCommandUsePackage( cmd )
+    let oldpos = getpos( '.' ) 
     call SlimvFindPackage()
     let s:refresh_disabled = 1
     call SlimvCommand( a:cmd )
     let s:swank_package = ''
+    call setpos( '.', oldpos ) 
     let s:refresh_disabled = 0
     call SlimvRefreshReplBuffer()
 endfunction
     endif
 endfunction
 
-" Inspect symbol
+" Inspect symbol under cursor
 function! SlimvInspect()
-    let s = input( 'Inspect: ', SlimvSelectSymbol() )
+    let s = input( 'Inspect: ', SlimvSelectSymbolExt() )
     if s != ''
         if g:slimv_swank
             if s:swank_connected
 endfunction
 
 function! SlimvCompileRegion() range
+    let oldpos = getpos( '.' ) 
     let lines = SlimvGetRegion()
     let region = join( lines, "\n" )
     call SlimvFindPackage()
         let region = substitute( region, '"', '\\\\"', 'g' )
         call SlimvEvalForm1( g:slimv_template_compile_string, region )
     endif
+    call setpos( '.', oldpos ) 
 endfunction
 
 " ---------------------------------------------------------------------