Comments (5)
It might depend on vim version. I was seeing it after some bootstrap.vim changes in bazelbuild/vim-bazel@905478a when I ran vroom locally, but NOT when I ran it via Travis CI, and also NOT when I ran neovim mode.
from vim-maktaba.
Looking at this today with @snu5mumr1k, it seems like a plausible fix might be:
- Move the definition of
maktaba#Maktaba()
up withinautoload/maktaba.vim
so that it's available immediately, before the call tomaktaba#plugin#GetOrInstall()
. This will require doing something likelet s:maktaba = 0
at global scope first to make that variable defined, albeit with a temporary invalid value. - Add something like
maktaba#plugin#InternalInstallMaktaba(dir)
for bootstrapping that does something like:to overwrite the value oflet s:maktaba = maktaba#plugin#GetOrInstall(s:plugindir) return s:maktaba
s:maktaba
set inautoload/maktaba/plugin.vim
by the call tomaktaba#Maktaba()
during its initial load. - Call that new function inside
autoload/maktaba.vim
instead of the genericmaktaba#plugin#GetOrInstall()
.
from vim-maktaba.
SG except that instead of using a temporary value of 0
, we should probably use a minimal dict that we can hopefully update in-place, so that anything internal that does save the output of maktaba#Maktaba()
in the meantime isn't permanently stuck with a dummy value.
from vim-maktaba.
I was actually thinking the other way around: using 0
means that it'll be completely obvious if anyone tries to use a partial/invalid value (which I don't think they do, fortunately).
However, you make a good point, as we could perhaps simplify this with just autoload/maktaba.vim
looking like:
let s:maktaba = {}
""
" Returns a handle to the maktaba plugin object.
function! maktaba#Maktaba() abort
return s:maktaba
endfunction
let s:plugindir = expand('<sfile>:p:h:h')
if !exists('s:maktaba')
call extend(s:maktaba, maktaba#plugin#GetOrInstall(s:plugindir))
let s:maktaba.globals.installers = []
let s:maktaba.globals.loghandlers = maktaba#reflist#Create()
endif
(entirely untested though)
from vim-maktaba.
You're right, there are cons either way. IIUC we can't actually guarantee the placeholder value never gets used the way the circular dependency works so I was looking to make it try hard to recover, but it's also possible it'll still fail and just be all the harder to troubleshoot. 🤷
Another possibility would be to change the maktaba#plugin
file to move the s:maktaba
setup inside functions and have them call maktaba#Maktaba()
on demand.
from vim-maktaba.
Related Issues (20)
- New vim-job based CallAsync doesn't handle complex commands correctly
- Merge vim-selector into maktaba
- maktaba#test#Override no longer working reliably for autoload funcs since vim 8.0.1378 HOT 2
- maktaba#syscall# doesn't work properly for Windows HOT 3
- Implement #mapping#MapUntilTimeout
- maktaba#syscall fails with E766 when throwing a ShellError for stderr containing a printf format string
- Syscall.CallAsync struggles with large stdins HOT 2
- Broken links in Wiki HOT 1
- Error formatting file: ERROR(NotFound): Python module maktaba HOT 3
- Remove need for delays when testing neovim jobcontrol HOT 2
- maktaba#plugin#Enter chokes with cryptic E896 error if it finds a flag called "plugin" HOT 1
- IsBool should handle v:true and v:false HOT 1
- E704 using funcref as selector mapping HOT 2
- Deprecate misc instant/*.vim files HOT 2
- Poetry/pipenv support? HOT 5
- maktaba#function#Filter modifies input HOT 2
- GH run-tests actions failing for ubuntu-latest os (with error about missing impish Release file) HOT 2
- maktaba#value#AsList helper
- matkaba#value#TypeMatches and friends should support recursively checking nested list element types
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 vim-maktaba.