Skip to content

Commit 0a9df41

Browse files
committed
Fix :ReplLog command
1 parent 31a6af7 commit 0a9df41

File tree

5 files changed

+8
-10
lines changed

5 files changed

+8
-10
lines changed

socket-repl-plugin/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ are available to create your own mappings:
4444
:EvalForm
4545
:ReplLog
4646
```
47+
4748
Unlike the `<leader>rlog` mapping, the `:ReplLog` command simply adds the repl
4849
log to the current pane.
4950

socket-repl-plugin/plugin/socketrepl.vim

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ if !exists('g:disable_socket_repl_mappings')
4747
4848
function! ShowLog()
4949
vnew
50-
ReplLog
51-
norm 
52-
norm 
50+
call ReplLog()
5351
endfunction
5452
nnoremap <leader>rlog :call ShowLog()<cr>
5553
endif

socket-repl-plugin/plugin/socketrepl.vim.debug

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ if !exists('g:disable_socket_repl_mappings')
3131

3232
function! ShowLog()
3333
vnew
34-
ReplLog
35-
norm 
36-
norm 
34+
call ReplLog()
3735
endfunction
3836
nnoremap <leader>rlog :call ShowLog()<cr>
3937
endif
Binary file not shown.

socket-repl-plugin/src/socket_repl/socket_repl_plugin.clj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,10 @@
158158
(fn [msg]
159159
(update-last!)
160160
(nvim/run-command-async!
161-
(format ":term tail -f %s" (-> @current-connection
162-
:file
163-
.getAbsolutePath))
161+
(format ":call termopen('tail -f %s') | stopinsert | exe \"normal \\<C-w>\\<C-x>\""
162+
(-> @current-connection
163+
:file
164+
.getAbsolutePath))
164165
(fn [_]))
165166

166167
;; Native solution, but only seems to work when the buffer has focus.
@@ -179,7 +180,7 @@
179180
(Thread/sleep 30000)
180181
(let [elapsed-msec (- (System/currentTimeMillis)
181182
(:last @current-connection))]
182-
(when (< elapsed-msec 60000)
183+
(when (> elapsed-msec (* 10 60000))
183184
(recur))))
184185

185186
;; Let nvim know we're shutting down.

0 commit comments

Comments
 (0)