joaotavora / darkroom

Simple distraction-free editing
147 stars 12 forks source link

darkroom--leave doesn't check for tentative-mode and one-window situation #10

Closed livtanong closed 5 years ago

livtanong commented 5 years ago

Repeatedly toggling darkroom-tentative-mode when buffer is not the only open window triggers text-scale-decrease, without corresponding text-scale-increase, causing an unbounded decrease in text size.

https://github.com/joaotavora/darkroom/blob/master/darkroom.el#L307

joaotavora commented 5 years ago

Oh, that explains some buggy behaviour I had been seeing. Do you have a (relatively simple) solution you want to suggest?

livtanong commented 5 years ago

Off the top of my head, store in some variable like text-scale-has-increased which becomes t when scale has been increased at some point, and only text-scale-decrease if this variable is t. If this is acceptable to you, I can make a PR.

livtanong commented 5 years ago

Found an even cleaner fix: just set (text-scale-mode -1).