cm-typewriter-scroll-obsidian icon indicating copy to clipboard operation
cm-typewriter-scroll-obsidian copied to clipboard

Not working in Vim's normal mode

Open erichalldev opened this issue 4 years ago • 12 comments

This is a wonderful plugin! I use Vim mode and I noticed when I'm in insert mode it works as expected, but when I'm in normal mode it behaves like normal and the cursor doesn't stay in the center of the screen. When I return to insert mode and move the cursor, the current line is centered as expected.

erichalldev avatar Nov 23 '20 02:11 erichalldev

Thanks. I don't use vim mode, so I wouldn't have caught this 😅

Interestingly, the "cursorActivity" event isn't being fired by CodeMirror when in vim mode. I wonder if there's some other event I should be tapping in to...

deathau avatar Nov 23 '20 03:11 deathau

I tried to look into this a bit more, but I've got no idea what I'm looking at, so I'm marking this as "help wanted" and will come back to it another time

deathau avatar Dec 29 '20 01:12 deathau

Hey, I think this might be working as of the latest commit 🤞

deathau avatar May 13 '21 23:05 deathau

Hi, I tested it and it works for me! Thank you! You can make another release, I guess :)

nkruglikov avatar May 27 '21 17:05 nkruglikov

Hey, it doesn't work for me. I'm running the latest version (obsidian and plugin) on mac with many plugins. any ideas or fixes?

th4lmain avatar Aug 15 '21 04:08 th4lmain

@th4lmain Unfortunately, commit with the fix is not included in the latest release. I got it working by cloning the repo and manually copying relevant files into my plugin folder.

nkruglikov avatar Aug 15 '21 10:08 nkruglikov

It's not working for me either. @deathau I think you have to publish a version with the last commit.

dimas-cyriaco avatar Nov 10 '21 14:11 dimas-cyriaco

Not working for me. Had to copy changes in commit with fix to get it working.

ChrisBarfod avatar Jan 04 '22 13:01 ChrisBarfod

@ChrisBarfod Could you describe what you did exactly? I can't seem to get it working, by unzipping cm-typewriter-scroll-obsidian-0.2.1.zip from here (https://github.com/deathau/cm-typewriter-scroll-obsidian/releases/tag/0.2.1) and placing it in the plugins folder.

SebastianBehrens avatar Mar 01 '22 18:03 SebastianBehrens

Looks like this might already be fixed. But I'll just add that vim normal mode works in the legacy editor. Perhaps useful as an alternative to manually applying the patch.

Edit: Though the center offset seems not to work in this case.

Otard95 avatar May 24 '22 06:05 Otard95

As of 0.2.2 this still doesn't work in the Live Preview editor. Can't see the magical patch people are referring to.

Amparose avatar Jun 30 '22 19:06 Amparose

I know this is an old issue, but in case anyone stumbles on this in the future... Until this is added properly into this plugin, I recommend using this plugin: https://github.com/lijyze/scroll-offset. Set the distance to something like 999 and it will behave exactly like :scrolloff in vim, even in vim normal mode.

yalikebaz avatar Nov 01 '22 20:11 yalikebaz