hundredrabbits / Left

Distractionless Writing Tool
http://hundredrabbits.itch.io/left
Other
1.78k stars 144 forks source link

navi bugfixes #28

Closed cantbesure1 closed 7 years ago

cantbesure1 commented 7 years ago

changes:

  1. added css tag to allow mouse over and click events in the list elements when the navi element is being used for dragging. On windows the list elements were broken when the frame was removed without this.
  2. fixed the 'scroll to' code in the go_to_fromtoand replace_linefunctions.

This was initially intended to just be the first change, but I noticed the second when I was about to commit, thinking it would be a small change. It took 6 hours. I pray I didn't miss a bug.

neauoire commented 7 years ago

Mhmm let me have a thorough look at this, I've tried to tackle this same issue before it caused more problem than good.

cantbesure1 commented 7 years ago

the solution I found was to create a temporary div, with css emulating the actual textarea (given that you cannot measure the height of a textarea directly). It's probably not amazing on resources, but given that it triggers only on a specific function and not every update, the difference is marginal. Alternatively, it could not work on other operating systems, in which case I'll have to rethink the entire thing.

also, I commited a few smaller changes (not bugfixes this time) changes:

  1. added marker num option, the css was already there so the additional code is pretty minimal
  2. changed the marker parser(again). It now supports indefinitely nested markers.
  3. changed the li note transformation to lowercase instead of capitalize. With multiple word markers, the capitalization looked a little off. That being said, this is more or less personal preference, so feel free to flip it back.
neauoire commented 7 years ago

Okay :) That's perfect, quite elegant solution too!