io12 / org-fragtog

Automatically toggle Org mode LaTeX fragment previews as the cursor enters and exits them
MIT License
397 stars 14 forks source link

Point positioned properly after entering LaTeX environments from the end. #40

Closed wosined closed 2 years ago

wosined commented 2 years ago

Before this change the point always moved to the start of the LaTeX environment. Even if the point entered the environment from bellow. This change places the point at the end of the environment if it enters the environment from bellow. The point column is the same as it was before entering the environment. The case where org-fragtog--prev-point is not defined (if the file was just opened and the point is inside a LaTeX environment) is also handled.

io12 commented 2 years ago

Sorry, I deleted this PR by accident but I incorporated your changes and made a few improvements in https://github.com/io12/org-fragtog/commit/ede4ac61e8cb580f63f882bdee2b0e573cd3dd60. Thanks so much for this and sorry it took so long to review the PR.

wosined commented 2 years ago

No problem. I'm glad you find it usefull.