kepano / obsidian-minimal

A distraction-free and highly customizable theme for Obsidian.
https://minimal.guide
MIT License
3.72k stars 186 forks source link

Cursor skips lines seemingly at random when navigating with keyboard #308

Closed frankreporting closed 2 years ago

frankreporting commented 2 years ago

Confirmed that the bug is not present when Minimal theme is off.

Describe the bug Ever since the new cursor in latest insider desktop version of Obsidian (0.14.10), I've noticed the cursor jumps unexpectedly.

To reproduce Try arrowing up and down, left and right, and move through at least a couple different types of formatting, including checklist and admonition/callout. Also try using the keyboard shortcuts to jump to beginning/end of line (i.e. ⌘← and ⌘→ on macOS).

Expected vs. actual behavior Cursor should move up and down one line at a time, or it should jump to the beginning or end of the existing line. If already at the beginning/end of a line, it shouldn't move at all. Instead, up/down sometimes skips a line, or jumps to the end of a callout even though starting from several lines above the callout. Also, if already at the beginning of a line, and using ⌘ key to jump to beginning of line, instead the cursor jumps to beginning/end of file.

Screenshots

https://user-images.githubusercontent.com/2828254/168212123-9100c28b-9445-42ed-9852-f5fbd97c3646.mov

Debug info (required):

SYSTEM INFO:
    Obsidian version: v0.14.10
    Installer version: v0.14.6
    Operating system: Darwin Kernel Version 21.4.0: Fri Mar 18 00:46:32 PDT 2022; root:xnu-8020.101.4~15/RELEASE_ARM64_T6000 21.4.0
    Login status: logged in
    Catalyst license: vip
    Insider build toggle: on
    Live preview: on
    Legacy editor: off
    Base theme: dark
    Community theme: Minimal
    Snippets enabled: 11
    Safe mode: off
    Plugins installed: 56
    Plugins enabled: 56
        1: Dataview
        2: Better Word Count
        3: Calendar
        4: Contextual Typography
        5: Copy as HTML
        6: CustomJS
        7: Editor Syntax Highlight
        8: Find unlinked files and unresolved links
        9: Force note view mode
        10: Get Info
        11: Hider
        12: Hotkeys for templates
        13: Imgur Plugin
        14: Jump to link
        15: Link Favicons
        16: Metadata Extractor
        17: MetaEdit
        18: Folder Note
        19: Advanced Cursors
        20: Advanced Mobile Toolbar
        21: Advanced Slides
        22: Advanced Tables
        23: Advanced URI
        24: Auto Link Title
        25: Customizable Page Header and Title Bar
        26: Hotkeys++
        27: Wikilinks to MDLinks
        28: Typewriter Scroll
        29: Templater
        30: Task Collector (TC)
        31: Tag Wrangler
        32: Style Settings
        33: Sortable
        34: Show Whitespace
        35: Remember cursor position
        36: ReadItLater
        37: QuickAdd
        38: Quick Switcher++
        39: Quick Explorer
        40: Paste URL into selection
        41: Pane Relief
        42: Pandoc Plugin
        43: Note Folder Autorename
        44: Natural Language Dates
        45: Native Scrollbars
        46: Multi-cursor
        47: Minimal Theme Settings
        48: Markdown Attributes
        49: Admonition
        50: Another Quick Switcher
        51: Obsidian42 - Jump-to-Date
        52: Obsidian42 - BRAT
        53: Focus Mode
        54: User Plugins
        55: Readwise Official
        56: Citations

RECOMMENDATIONS:
    Custom theme: for cosmetic issues, please first try updating your theme to latest. If still not fixed, please try to make the issue happen in the help vault or disable community theme and snippets.
    Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the help vault or disable community plugins.
kepano commented 2 years ago

I am not able to reproduce this. Have you tried in a new vault without plugins/snippets?

frankreporting commented 2 years ago

Yeah. Clean vault had no issues. Let me do some more thorough plug-in testing

frankreporting commented 2 years ago

Actually I suddenly can't reproduce either. Very odd. Closing this. Sorry for the false alarm!

frankreporting commented 2 years ago

Fwiw I did manage to recreate, but it appears to be something caused by my implementation of Dataview and customJS to render tasks. Again, sorry for the false alarm.

LucaMarconato commented 9 months ago

I am experiencing the same problem. Can't reproduce systematically but the problem appears every now and then.

svenschuldt commented 9 months ago

Same thing on my side: I have a daily note template in which I have a section with bullet points. When I start typing on the first or any other bullet point after a few words the cursor jumps to any point in the current note. When I turn the minimal theme off, this does not happen, that is unfortunate, as I really like this theme.

kepano commented 9 months ago

@svenschuldt I need more specific steps to reproduce. Please include a sample file, and make sure you can reproduce in a new vault with only Minimal Theme + Minimal Theme Settings

svenschuldt commented 9 months ago

I need to sincerely apologize: it looked at the beginning that it worked with the minimal theme - but the cursor does skip as well. It seems to happen in notes that have a number of dataview/dataviewjs tables which keep on updating. I need to dig deeper there!

Nothing to do with minimal theme - SORRY!

KuduAdmin commented 9 months ago

FWIW, I had the same/similar issue with ITS Theme.

Spun up a clean test vault and the issue is replicable when using ITS but, interestingly enough, I can't replicate it with Minimal theme.

LucaMarconato commented 9 months ago

I think I solved it. I had added this .css code in my config to reduce the interline space. Removing it made the cursor bug disappear.

.mod-cm6 .cm-editor .HyperMD-header, .markdown-reading-view .markdown-preview-section :is(h1,h2,h3,h4,h5,h6) {
    line-height: 1em !important;
    margin:2px 0px 2px 0px !important;
    padding: 1px 0px 2px 0px !important;
}