Comments (4)
I have the same issue.
I'm using pathogen to load vlime.
Same vim, also on archlinux:
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Jan 26 2020 11:45:38)
Included patches: 1-148
Compiled by Arch Linux
SBCL 2.0.1
ceee9fe (HEAD, origin/master, origin/HEAD, master) Fix *json-cache* to work on other implementations than SBCL.
from vlime.
Developments:
-
Issue is not reproducible in NeoVim.
-
Here's where it's triggered from:
In autoload/vlime/ui/input.vim
,
In function vlime#ui#input#FromBuffer
:
augroup VlimeInputBufferLeaveAu
autocmd!
execute 'autocmd BufWinLeave <buffer> bunload!' buf
augroup end
:bunload!
discards changes, closes any windows for this buffer, and frees the memory allocated for it. BufWinLeave
is triggered before a buffer is removed from a window, not when it's still visible in another window, also triggered when exiting.
The Input buffer has setbufvar(buf, '&buflisted', 0)
, which means it doesn't show up in the operations involving the buffer list. To show all buffers the including unlisted ones, we can use :buffers!
. Which, reasonably enough, the Input buffer shows up in, regardless of whether the above autocommand is present.
So the idea behind this line is to unload the memory allocated for whatever content we've put into the buffer, before we close it without removing from the (hidden-) buffer list. If we wanted to also remove it from the (hidden-) buffer list, we would use bdelete!
instead of bunload!
. Reasonably enough (since the former includes the latter), either command causes the same error.
Moving the autocommand up the autocommand stack to BufLeave
solves the error, however this autocommand is triggered upon switching windows as well, which means we can destroy the buffer before we submit, which is undesirable. The autocommands down the stack that we could attach to, are (BufUnload
, BufDelete
, ...) are not exactly what we need either, and also happen to trigger the error (even if the construct itself now makes little sense). We are attempting to delete a buffer that is in use. The E937
help pertains to a group of autocommand-related errors and does not clear up this issue.
- We run
bdelete!
when we submit the Input buffer anyways:
As defined in the same function vlime#ui#input#FromBuffer
we were discussing previously:
nnoremap <buffer> <silent> <cr> :call vlime#ui#input#FromBufferComplete()<cr>
vlime#ui#input#FromBufferComplete
calls the clean up by itself:
execute 'bdelete!' input_buf
Which means the following: the buffer IS being run bdelete!
on, (which itself triggers bunload!
), when it's submitted with the <CR>
key.
So the only case where the problematic autocommand is relevant, is when we forcibly close the buffer without submitting it first. Which is problematic in itself, because further Lisp calls that would otherwise trigger the buffer, are put on hold until we find the buffer number in the buffers!
list (because it's otherwise hidden from buffer-related commands), and then switch to it by it's number, e.g. :b 5
. After that the situation resolves itself and the Input buffer will appear as many times as it was needed for the queued calls.
An alternative to deleting the autocommand outright, is to place it in an optional nvim block:
if has('nvim')
augroup VlimeInputBufferLeaveAu
autocmd!
execute 'autocmd BufWinLeave <buffer> bunload!' buf
augroup end
endif
from vlime.
Another way of addressing this can be seen in pull request #48, which is handling the unload in a try block:
function! s:BufUnload(buf) abort
try
execute 'bunload!' a:buf
catch /^Vim\%((\a\+)\)\=:E937:/
return
endtry
endfunction
augroup VlimeInputBufferLeaveAu
autocmd!
execute 'autocmd BufWinLeave <buffer> call s:BufUnload(' buf ')'
augroup end
Which seems more idiomatic than introducing an unwarranted nvim
branch like above. I humbly call for @fukamachi to merge it!
from vlime.
Deleting the problematic block entirely also seems like a valid option, as the functionality it brings is highly questionable, as discussed in above #51 (comment).
from vlime.
Related Issues (20)
- Connecting to running Swank server? HOT 25
- Installation issues on MacOS with Pathogen HOT 3
- Implement the Parinfer algorithm HOT 2
- Request consideration to "rename" the project HOT 1
- How to get autocomplete? HOT 3
- Don't escape ANSI escape sequences
- `sldb` buffer doesn't work on OpenBSD HOT 7
- Weird highlight behavior inside the REPL buffer HOT 1
- SBCL warnings seem to break the REPL connection HOT 22
- can't press `d` to inspect frame in debugger HOT 4
- Interactively macro-expand a form HOT 2
- Rebind your leaders for weird outcome HOT 1
- Fix this bug introduced by upstream: thread waiting HOT 2
- Slynk support...? HOT 2
- Bug in commit cfaac6ccb379f9f85bfb2ef17ca6369dfadf2be6
- neovim swank:close-connection: end of file HOT 18
- Cusomtizing *print-case* Breaks Restarts HOT 11
- "Manual Install" Failing UI Test, Mappings default to slimv HOT 4
- Quote HOT 2
- Add a feature to load a system (similar to `M-x slime-load-system` in SLIME) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vlime.