Code Monkey home page Code Monkey logo

Comments (5)

fcFn avatar fcFn commented on September 22, 2024 1

This plugin works perfectly: https://github.com/davisriedel/obsidian-typewriter-mode

from cm-typewriter-scroll-obsidian.

lebigot avatar lebigot commented on September 22, 2024

PS: It is as if Typewriter Scroll was hesitating between two positions on the screen: a first position where the text is shown for a very short time, and then the final position. Each time I press a key, the first position is used, and then the final position.

from cm-typewriter-scroll-obsidian.

TonyAtlas avatar TonyAtlas commented on September 22, 2024

I have the same effect, but it appears on any note. When I activated the plugin, at first everything worked almost normally. These jumps also happened, but much less often. But then for some reason they also began to happen from every click. Although I did not change anything.

Reboot did not help.

OS: Windows 10
Obsidian 1.3.5.

from cm-typewriter-scroll-obsidian.

mattdaviscodes avatar mattdaviscodes commented on September 22, 2024

Same issue.

from cm-typewriter-scroll-obsidian.

Caffa avatar Caffa commented on September 22, 2024

@fcFn I found the other plugin to be really buggy. Utterly unusable.

This seems to be linked to a previously closed issue #6 but I checked my current plugin is up to date and the code changes for the onRefresh function are corrected according to this fix (Line 136).

I have also found the same problem of 'each character causes the window to go up and down' but my zen mode is deactivated and the document is rather long. This doesn't happen for all lines, but a shaky line remains shaky for the whole line. I think this may be due to how we divide the offsetHeight - how is it rounded?

function onRefresh(cm) {
    const halfWindowHeight = Math.ceil(cm.getWrapperElement().offsetHeight / 2);
    const linesEl = cm.getScrollerElement().querySelector('.CodeMirror-lines');
    linesEl.style.paddingTop = `${halfWindowHeight}px`;
    linesEl.style.paddingBottom = `${halfWindowHeight}px`; // Thanks @walulula!
    if (cm.getSelection().length === 0) {
        cm.execCommand("scrollSelectionToCenter");
    }
}

so I did this fix

from cm-typewriter-scroll-obsidian.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.