Commits

Tamas Kovacs committed 80ffc58

Version 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).

  • Participants
  • Parent commits 031ebf0

Comments (0)

Files changed (4)

-*slimv.txt*                    Slimv                 Last Change: 21 Jan 2011
+*slimv.txt*                    Slimv                 Last Change: 17 Feb 2011
 
 Slimv                                                                  *slimv*
-                               Version 0.7.6
+                               Version 0.7.7
 
 The Superior Lisp Interaction Mode for Vim.
 This plugin is aimed to help Lisp development by interfacing between Vim and
 
                                                                *g:slimv_python*
 This is the installation path of the Python interpreter.
+Normally the Python path is autodetected, but sometimes autodetection fails
+and you need to set up the path in your .vimrc file explicitly.
+If the Python path contains space characters then either the spaces should be
+escaped (Linux) or the short 8.3 filename format should be used (Windows).
+Enclosing the full Python path in double quotes may also work, but this depends
+on the command string handling of the console command used (xterm/cmd.exe/etc).
 Example:
     let g:slimv_python = 'C:/MyPythonDir/python.exe'
 
 ===============================================================================
 CHANGE LOG                                                    *slimv-changelog*
 
+0.7.7  - Paredit: find next closing paren when using ,< or ,> and not standing
+         on a paren.
+       - Open REPL buffer upon connecting server.
+       - Bugfix: REPL buffer prompt identification was sometimes missing.
+       - Bugfix: switch off REPL refresh mode when REPL buffer is not visible
+         (thanks to Philipp Marek).
+       - Bugfix: convert Python path on Windows to short 8.3 filename format
+         if it contains space (thanks to Razvan Rotaru).
+
 0.7.6  - Cursor potision is kept during evaluation.
        - Most Slimv commands made silent.
        - Bugfix: find defun start when cursor is on a comment.

ftplugin/slimv.py

 #
 # Client/Server code for Slimv
 # slimv.py:     Client/Server code for slimv.vim plugin
-# Version:      0.7.5
-# Last Change:  30 Dec 2010
+# Version:      0.7.7
+# Last Change:  06 Feb 2011
 # Maintainer:   Tamas Kovacs <kovisoft at gmail dot com>
 # License:      This file is placed in the public domain.
 #               No warranty, express or implied.
     input_filename = ''
     output_filename = ''
 
-    # Always this trouble with the path/filenames containing spaces:
-    # enclose them in double quotes
-    if python_path.find( ' ' ) >= 0:
-        python_path = '"' + python_path + '"'
-
     # Get command line options
     try:
         opts, args = getopt.getopt( sys.argv[1:], '?hsf:o:p:l:r:d:', \

ftplugin/slimv.vim

 " slimv.vim:    The Superior Lisp Interaction Mode for VIM
-" Version:      0.7.6
-" Last Change:  18 Jan 2011
+" Version:      0.7.7
+" Last Change:  17 Feb 2011
 " Maintainer:   Tamas Kovacs <kovisoft at gmail dot com>
 " License:      This file is placed in the public domain.
 "               No warranty, express or implied.
         " Try to find Python on the standard installation places
         " For Cygwin we need to use the Windows Python instead of the Cygwin Python
         let pythons = split( globpath( 'c:/python*,c:/Program Files/python*', 'python.exe' ), '\n' )
-        if len( pythons ) > 0
-            return pythons[0]
+        if len( pythons ) == 0
+            " Go deeper in subdirectories
+            let pythons = split( globpath( 'c:/python*/**,c:/Program Files/python*/**', 'python.exe' ), '\n' )
+            if len( pythons ) == 0
+                return ''
+            endif
         endif
-        " Go deeper in subdirectories
-        let pythons = split( globpath( 'c:/python*/**,c:/Program Files/python*/**', 'python.exe' ), '\n' )
-        if len( pythons ) > 0
-            return pythons[0]
+        let pycmd = pythons[0]
+        if match( pycmd, ' ' ) >= 0
+            " Convert Python command to short 8.3 format if path contains spaces
+            let pycmd = fnamemodify( pycmd, ':8' )
         endif
-        return ''
+        return pycmd
     else
         return ''
     endif
     syntax on
     setlocal autoread
     call SlimvEndOfReplBuffer()
+    call SlimvMarkBufferEnd()
     set nomodified
 
     if repl_buf != this_buf
     execute "au FileChangedRO " . g:slimv_repl_file . " :call SlimvRefreshModeOff()"
     call SlimvRefreshModeOn()
     call SlimvRefreshReplBuffer()
-    call SlimvMarkBufferEnd()
 endfunction
 
 " Called when leaving REPL buffer
     catch /.*/
         " REPL menu not found, we cannot remove it
     endtry
-    call SlimvRefreshModeOn()
-    call SlimvRefreshReplBuffer()
-    call SlimvMarkBufferEnd()
+    if g:slimv_repl_split
+        call SlimvRefreshModeOn()
+        call SlimvRefreshReplBuffer()
+    else
+        call SlimvRefreshModeOff()
+    endif
 endfunction
 
 " Open a new REPL buffer or switch to the existing one
 
 " Find starting '(' of a top level form
 function SlimvFindDefunStart()
-    while searchpair( '(', '', ')', 'bW', 'synIDattr(synID(line("."), col("."), 0), "name") =~ "[Ss]tring\\|[Cc]omment"' )
+    let l = line( '.' )
+    let matchb = max( [l-100, 1] )
+    while searchpair( '(', '', ')', 'bW', 'synIDattr(synID(line("."), col("."), 0), "name") =~ "[Ss]tring\\|[Cc]omment"', matchb )
     endwhile
 endfunction
 
 " Start and connect slimv server
 " This is a quite dummy function that just evaluates the empty string
 function! SlimvConnectServer()
-    call SlimvSend( ['SLIMV::OUTPUT::' . s:repl_name ], 0 )
+    call SlimvSend( ['SLIMV::OUTPUT::' . s:repl_name ], g:slimv_repl_open )
 endfunction
 
 " Refresh REPL buffer continuously

plugin/paredit.vim

 " paredit.vim:
 "               Paredit mode for Slimv
-" Version:      0.7.6
-" Last Change:  13 Jan 2010
+" Version:      0.7.7
+" Last Change:  14 Feb 2010
 " Maintainer:   Tamas Kovacs <kovisoft at gmail dot com>
 " License:      This file is placed in the public domain.
 "               No warranty, express or implied.
     if line[c0-1] =~ s:any_macro_prefix && line[c0] =~ s:any_opening_char
         normal! l
     endif
+
+    " If still not standing on a paren then find the next closing one
+    if line[c0-1] !~ s:any_openclose_char
+        call search(s:any_closing_char, 'W')
+    endif
 endfunction
 
 " Move delimiter one atom or s-expression to the left