Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fold and unfold all exmap #32

Closed
DannyDies opened this issue Jun 18, 2021 · 5 comments
Closed

fold and unfold all exmap #32

DannyDies opened this issue Jun 18, 2021 · 5 comments

Comments

@DannyDies
Copy link

DannyDies commented Jun 18, 2021

Hey! Great work with plugins, now vim in obsidian really more useful.

I trying to map fold and unfold all. Console throws type exception.

Uncaught (in promise) TypeError: Cannot read property 'getMode' of undefined
    at editorCheckCallback (app.js:1)
    at VimrcPlugin.eval (eval at <anonymous> (app.js:1), <anonymous>:557:33)
    at step (eval at <anonymous> (app.js:1), <anonymous>:66:23)
    at Object.eval [as next] (eval at <anonymous> (app.js:1), <anonymous>:47:53)
    at eval (eval at <anonymous> (app.js:1), <anonymous>:40:71)
    at new Promise (<anonymous>)
    at __awaiter (eval at <anonymous> (app.js:1), <anonymous>:36:12)
    at Object.eval [as obcommand] (eval at <anonymous> (app.js:1), <anonymous>:541:89)
    at ExCommandDispatcher._processCommand (cm-addons.js:4635)
    at cm-addons.js:4581
@esm7
Copy link
Owner

esm7 commented Jun 20, 2021

I was unable to get the fold commands to work (perhaps they collide with the Vim mode), but was also unable to recreate the exception that you got.
Can you elaborate more on where you're at? e.g. what's the exact command you're executing, what's the editor status etc?

@DannyDies
Copy link
Author

DannyDies commented Jun 20, 2021

@esm7 Obsidian v 0.12.4 appimage. installer 0.12.3. Plugin updated for latest versions.
In obsidian edit mode tried to call from vim command mode. Also, mapped to key and tried in normal and visual modes. With opened console and without. Same result - same exception.
command:
:obcommand editor:fold-all
map:

exmap fl obcommand editor:fold-all
" tried also nmap and noremap. 
map <Space>jj :fl

p.s. Strange that defaults za and zc vim fold commands work just fine. The only defaults folding that works.

@esm7
Copy link
Owner

esm7 commented Jun 21, 2021

Thanks for the details, found the issue and released a fix :)

@esm7 esm7 closed this as completed Jun 21, 2021
@DannyDies
Copy link
Author

@esm7 Awesome. Works perfectly. Thanx!

@DannyDies
Copy link
Author

@esm7 Updt: Not perfectly:D
Now it chooses only one opened pane and fold and unfold only within it. No matter what pane is focused on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants