Codi fails to print output for files with >1000 characters
lukelbd opened this issue · 5 comments
I am having these extremely strange/confusing issue where Codi will be working just fine on a python script, then suddenly I add certain lines and Codi will output nothing (often this happens when I'm just adding a comment line somewhere in the middle of the document). When Codi is outputting nothing, if I turn on synchronous-mode (i.e. let g:codi#sync=1), VIM will freeze if I call :CodiUpdate
.
Also, when I call :CodiUpdate
, my logfile contains only the single line
[00:14:35.363192] <SNR>102_user_au[1]: Doing autocommand CodiUpdatePre
i.e. the lines are not being read... perhaps we are somehow frozen on a pre-processing step. Any idea what could be going on?
Can you give some example input which consistently reproduces the issue?
Sorry for not including an example. After posting this issue I think I gave up on codi and switched to numi :P. Well now I'm trying to switch back because I love vim.
The issue seems to appear when the file exceeds a certain number of characters. For example with the following file calculator.py
everything is fine:
a = 1
a
# foobar foobar foobar foobar foobar foobar foobar foobar foobar
# foobar foobar foobar foobar foobar foobar foobar foobar foobar
# foobar foobar foobar foobar foobar foobar foobar foobar foobar
# foobar foobar foobar foobar foobar foobar foobar foobar foobar
# foobar foobar foobar foobar foobar foobar foobar foobar foobar
# foobar foobar foobar foobar foobar foobar foobar foobar foobar
# foobar foobar foobar foobar foobar foobar foobar foobar foobar
# foobar foobar foobar foobar foobar foobar foobar foobar foobar
# foobar foobar foobar foobar foobar foobar foobar foobar foobar
# foobar foobar foobar foobar foobar foobar foobar foobar foobar
# foobar foobar foobar foobar foobar foobar foobar foobar foobar
# foobar foobar foobar foobar foobar foobar foobar foobar foobar
# foobar foobar foobar foobar foobar foobar foobar foobar foobar
# foobar foobar foobar foobar foobar foobar foobar foobar foobar
and the interpreter output 1
appears in the side panel next to the line a
.
However, if I add another comment line, the output no longer appears in the side panel. The limit appears to be number of characters, not number of lines -- if I instead add short lines e.g. containing a single # foobar
, then I need to add way more lines for the interpreter output to disappear.
In my .vimrc
I specify the python interpreter as the macOS native python 2 interpreter (but I tested this issue with the python interpreter from my anaconda distribution so I think it is not specific to the python version):
let g:codi#interpreters = {
\ 'python': {
\ 'bin': '/usr/bin/python',
\ 'prompt': '^\(>>>\|\.\.\.\) ',
\ },
\ }
Hopefully this helps! Really want to start using codi for everything.
I tested this more closely and the issue appears when the file exceeds exactly 1000 characters. A suspiciously round number!