Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maintain cursor position when indenting #125

Merged
merged 1 commit into from
Mar 29, 2016

Conversation

ihodes
Copy link
Contributor

@ihodes ihodes commented Mar 25, 2016

Now, when `markdown-indent-line' is called, the cursor stays on the
character it was on, instead of ending up at the beginning of the line.

Example: http://link.isaachodes.io/3Q04333E1j2k

Now, when `markdown-indent-line' is called, the cursor stays on the
character it was on, instead of ending up at the beginning of the line.
@@ -4161,12 +4161,19 @@ these cases, indent to the default position.
Positions are calculated by `markdown-calc-indents'."
(interactive)
(let ((positions (markdown-calc-indents))
(cursor-pos (current-column))
(_ (back-to-indentation))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks a little gross, but the alternative is another level of let-bindings; let me know if you see a third path, or prefer something else!

@jrblevin jrblevin merged commit 5271da9 into jrblevin:master Mar 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants