-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hack forward-paragraph-func so fill-region skips code blocks
Also Rename `markdown-fill-forward-paragraph-function` to `markdown-fill-forward-paragraph`. Includes three test cases. Closes GH-192. The trick here is to make `markdown-fill-forward-paragraph` move asymmetrically when called with argument 1 and -1. Consider this file with important positions indicated by (n): <-- (0) par 1 <-- (1) ``` code ``` <-- (2) par 2 <-- (3) Starting at `point-min` (0), calling `(markdown-fill-forward-paragraph 1)` repeatedly first moves to (1). This identifies the first paragraph that `fill-region` will fill. With this patch, calling `(markdown-fill-forward-paragraph 1)` again moves to (3), fully skipping over (2). Once at (3), calling `(markdown-fill-forward-paragraph -1)` now moves back to (2). Thus, `fill-region` identifies the next paragraph as the paragraph between (2) and (3) rather than the code block (1) and (2).
- Loading branch information
Showing
3 changed files
with
84 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters