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

Broken in Obsidian Release v0.15.6 #118

Closed
afreemanio opened this issue Jul 14, 2022 · 12 comments
Closed

Broken in Obsidian Release v0.15.6 #118

afreemanio opened this issue Jul 14, 2022 · 12 comments

Comments

@afreemanio
Copy link

I had automatic updates on on my Obsidian - the next major version got released yesterday, and I woke up today to find that this plugin no longer works. Its not just the .vimrc either, it appears to not load at all. I can confirm downgrading my Obsidian version to v0.14.15 has fixed the issue, and I will be staying on this version of Obsidian until this plugin is updated to work with the new version (or if it turns out it was something wrong with me the whole time).

Thank you for the great plugin

@victorfeight
Copy link

victorfeight commented Jul 14, 2022

Can confirm it's broken in latest release.
Here is my .obsidian.vimrc (a simple one)

" Quickly remove search highlights
nmap <F9> :nohl

" Yank to system clipboard
set clipboard=unnamed

nmap j gj
nmap k gk

To replicate that it's not working, update to the latest version v0.15.6, try loading my .obsidian.vimrc, and note that yanking to system clipboard does not work nor moving visual lines with the mapping.

I have also downgraded as this plugin is essential for my workflow.

@esm7
Copy link
Owner

esm7 commented Jul 15, 2022

I need your help in pinpointing the issue, because I'm on 0.15.6 (and been on the 0.15.x insider builds for a few weeks now), and it kept working for me as usual.
Can you two elaborate a bit on:

  1. What OS are you using?
  2. Are you in the latest version of the plugin?
  3. The Obsidian legacy editor or the new one?
  4. What editing mode under Settings->Editor (live preview or source mode)?

@victorfeight
Copy link

Sure thing. With those troubleshooting steps, I got it working again with latest version. I'll walk through.

  1. Windows 10
  2. I was not using the latest version of the plugin when this bug occurred.
  3. I was using the new editor, as it was offered as an opt-in for the latest Obsidian version.
  4. I was using Live Preview when it was not working.

To fix it:

  1. Update Obsidian to latest again.
  2. Uninstall Vimrc support plugin, and re-install.
  3. Switch to Legacy editor (source mode).
  4. Restart Obsidian.

After these steps, It's working fine again and I would consider it solved if the steps work for OP. Thank you.

@esm7
Copy link
Owner

esm7 commented Jul 15, 2022

What about the combination of the latest plugin version, and live preview?
Could it be that you were using an older version of the Vimrc plugin before Live Preview support was added?

@victorfeight
Copy link

I just tried Live Preview with the latest plugin, and I can confirm it's working. Which is really nice, since it hadn't in previous versions.

I can ascertain that the combination of the newest Obsidian version (v0.15.6) and the prior Vimrc Support plugin version were what was causing the plugin to not work.

@afreemanio
Copy link
Author

My situation is similar to the above poster:

  1. Windows 10
  2. I was not using the latest version (0.6.2 as on the Community plugins page on Obsidian itself) of the plugin when this bug occured, though I tried updating the plugin as soon as I noticed it wasn't working and so my original post applies to 0.6.2.
  3. I had auto-updated my Obsidian to 0.15.6, 'Use legacy editor' was unselected, so I was on the new editor.
  4. I was using live preview.

I really hope this isn't just a me thing, but I can confirm on my machine that for Vimrc Support version 0.6.2, the plugin works as intended on Obsidian v0.14.15 with live preview enabled.
Upon upgrading my Obsidian to v0.15.6, the plugin is still no longer working with the new editor with preview mode on, and it is also no longer working with the legacy editor enabled without live preview.

I've also tried following the above suggested troubleshooting steps and they have not solved the issue for me.
If there are other potential fixes I'd be happy to give them a try - if you think it may be an order of steps thing as well I can try that, or if it has something to do with the updating of Obsidian (Installer version v0.14.15 -> Current version v0.15.6) then I could try a full reinstall if that might help.

@esm7
Copy link
Owner

esm7 commented Jul 15, 2022

@afreemanio can you restart Obsidian, open the Obsidian developer console (Ctrl+Shift+I) and paste everything that's in that console? There might be error messages or other printouts that could direct me about what's going on.
Another step that might help is to disable all community plugins other than Vimrc (and restart Obsidian afterwards) to try and understand if it might be a collision with a specific plugin.

@victorfeight
Copy link

victorfeight commented Jul 15, 2022

I don't know if it helps, but these were my exact steps.

  1. I'm on v0.15.6 with an older version of the plugin Vimrc. Not working.
  2. I downgraded to v0.14.15 with the older version, working.
  3. I then upgraded to v0.15.6. Live preview was enabled. Not working.
  4. I uninstalled the older version of Vimrc. Restarted Obsidian.
  5. I then downloaded the new version 0.6.2 from the Community Plugins. Enabled the plugin. Restarted Obsidian.
  6. At this point it was working, I enabled Live Preview. Working.

There was some bug earlier where when I disabled Vimrc in the options and restarted, and re-enabled it, it was no longer working. Restarting didn't work. Turning off and on Restricted mode also triggered similar behavior. I would try uninstalling the plugin, restarting, and installing again from Community Plugins, enable it, and restart once more, as that was my general line of actions to get it working again.

@esm7
Copy link
Owner

esm7 commented Jul 15, 2022

I can't think of anything in how this works that can explain why reinstalling the plugin would help, but a console printout can help shed light on it.
Also @afreemanio: it would be interesting if after the above, you could turn on the Legacy Editor in Obsidian's settings, restart Obsidian, turn it off, restart again, then see if something changes. There is some annoyance related to how the new editor can be detected in the API which might be failing on your system for some reason, and toggling the setting in Obsidian solves it.

@afreemanio
Copy link
Author

@esm7 Your most recent suggestion seems to fix it! It appears that turning on the Legacy Editor, restarting Obsidian, turning it off, then restarting Obsidian has fixed it.
This seems quite simple and it is also somewhat a part of the above troubleshooting steps I followed, so I'm not sure how I didn't do this already by accident - perhaps taking actions in between restarts (reinstalling) prevents it from working?

For reference, the console when it was not working:

Obsidian Developer Console
plugin:obsidian-vimrc-support:446 Vimrc plugin: using CodeMirror 5 mode

And when it is working:

Obsidian Developer Console
plugin:obsidian-vimrc-support:441 Vimrc plugin: using CodeMirror 6 mode
plugin:obsidian-vimrc-support:623 Vim is now set to yank to system clipboard.

If no further information is required, I would consider this issue solved on my end.

@esm7
Copy link
Owner

esm7 commented Jul 15, 2022

Awesome, your findings confirm my suspicion that the editor detection broke.
I think that now when the new editor is the default, I'll completely drop the support for the legacy editor, so there won't be a further need to run this hacky detection code.
Thanks for the help in pinpointing the issue.

@esm7
Copy link
Owner

esm7 commented Jul 17, 2022

Fixed (and CM5 is no longer supported) in 0.7.0.

@esm7 esm7 closed this as completed Jul 17, 2022
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

3 participants