cemerick / vim-fireplace

fireplace.vim: Clojure REPL tease, formerly foreplay.vim
2 stars 0 forks source link

REPLConnect and LoadFile fails with Python errors #1

Closed zilvinasu closed 11 years ago

zilvinasu commented 11 years ago

I am not sure if it's not some problem related to something missing in my system. What I did was used the same instructions provided in tpope/vim-fireplace repository and after that:

How I reproduced it

  1. Went to the project dir, started repl using: lein repl
  2. I located my project dir using Terminal.
  3. Opened some project file using Vim.
  4. Connected to previously created REPL instance using: :REPLConnect nrepl://localhost:63743 Error appeared for a second: Error 1
  5. Typing :LoadFile revealed another error
Error detected while processing function fireplace#load_file..fireplace#interactive..fireplace#pycall..fireplace#pyc
allk:
line    4:
  File "<string>", line 1
    vim_nrepl.interactive('''nrepl://localhost:63743''','''9dd58d69-0a64-447c-9872-564b455f51e5''',{'''file''':'''''
,'''file-name''':'''2013-07-12T04:00:09+0300.clj''','''op''':'''load-file''','''file-path''':'''/Users/hoppipolla/.f
ireplace_repl_logs//2013-07-12T04:00:09+0300.clj'''})

       ^
SyntaxError: invalid syntax

Edit: Forgot to mention, doing :REPLConnect it still opens new buffer instead of using the one on which I am executing the commands, not sure if that's expected behaviour.

cemerick commented 11 years ago

Yes, I hit this problem earlier tonight, and fixed locally. I'll push the fix tomorrow.

zilvinasu commented 11 years ago

So :REPLConnect opening new buffer also was not the expected behaviour, correct me if I am wrong, it should just give access to REPL in any of the selected buffers when I do :REPLConnect without creating a new one?

cemerick commented 11 years ago

Fix now on the async-python branch.

No, anything that starts a new session (including :REPLConnect, :REPLStartProject, and :REPLConnectProject) will open a new REPL session log buffer. Among many other things, one of the objectives of this branch is to allow you to have more than one REPL session going per-project, so it's entirely up to you how and when new connections/sessions are started.

zilvinasu commented 11 years ago

Just to clarify some things, if this branch is not meant to give ability for getting output in the same buffer, then each time I :Eval some code I am intended to switch to the buffer which shows the output so I can scroll down to see the result, otherwise it takes like five seconds till it scrolls down itself, but scrolling down only happens when executing :Eval, commands like cpp are not doing that.

What I am failing to understand is good practice of using this branch and it's separate REPL buffer

cemerick commented 11 years ago

What do you mean "get output in the same buffer"? There's three possible buffers in question:

  1. Clojure source files
  2. nREPL session logs
  3. the dedicated nREPL Input

Results and output always goes to (2).

The python side of the plugin does move the cursor in to the end of (2) immediately after result/output is written (iff the cursor was already on the last line when the output was written…if you've moved the point to some other line, i.e. while looking back in the log, then the cursor is left alone). The delay you're seeing is me being conservative with redraws at the moment; I'll return to the topic of getting the buffer scrolling in "real time" shortly.

At some point, I'll put together a screencast showing my workflow with the plugin, which will hopefully make it clear what I'm aiming for. Thanks for suffering through the growing pains in the meantime. :-)

zilvinasu commented 11 years ago

Ah thanks for the answer, made it more clear for me of how it works. Will be looking forward to screencast. :)