Coder Social home page Coder Social logo

Comments (2)

phmarek avatar phmarek commented on July 22, 2024

I believe that it should be sufficient to set the filetype=lisp in the preview window -- then the same keybindings should be available.

Well, the package should be set -- there's some buffer-specific variable for that, ISTR.

from vlime.

iamFIREcracker avatar iamFIREcracker commented on July 22, 2024

Yeah, that is a good starting point indeed (the following patch might not cleanly apply, as I had other local changes in the same file):

diff --git a/vim/autoload/vlime/ui.vim b/vim/autoload/vlime/ui.vim
index 01838df..0f3aa97 100644
--- a/vim/autoload/vlime/ui.vim
+++ b/vim/autoload/vlime/ui.vim
@@ -902,6 +943,7 @@ function! vlime#ui#ShowTransientWindow(
             \ conn, content, append, buf_name, win_name, ...)
     let file_type = get(a:000, 0, v:null)
     let old_win_id = win_getid()
+    let old_cur_package = a:conn.GetCurrentPackage()
     try
         let buf = vlime#ui#OpenBufferWithWinSettings(
                     \ a:buf_name, v:true, a:win_name)
@@ -919,6 +961,8 @@ function! vlime#ui#ShowTransientWindow(
                 call setbufvar(buf, 'vlime_conn', a:conn)
             endif
 
+            call a:conn.SetCurrentPackage(old_cur_package)
+
             setlocal modifiable
             if a:append
                 call vlime#ui#AppendString(a:content)
@@ -942,7 +986,7 @@ endfunction
 function! vlime#ui#ShowPreview(conn, content, append)
     return vlime#ui#ShowTransientWindow(
                 \ a:conn, a:content, a:append,
-                \ vlime#ui#PreviewBufName(), 'preview', 'vlime_preview')
+                \ vlime#ui#PreviewBufName(), 'preview', 'vlime_preview.lisp')
 endfunction
 
 ""

Unfortunately though, subsequent macroexpand operations will completely replace the content of the preview window, rather than expanding inline. I could live with that if that preview window had history support (so I could go back to the previous expansion); but it doesn't, and since I need to hack a few things anyways, I might as well try to implement the inline macroexpansion (or die trying!).

from vlime.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.