outshine-speed-commands-default: update to align with org equivalent #94
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix #91. This is a draft PR because there were two problems raised in that issue and so far it only solves one of them -- consistency between the default speed command lists in org and outshine.
The other is that -- unlike org -- outshine inserts new headings above old ones when
outshine-insert-heading
is called with a speed command.I found that this is because outshine only adds a newline for the new heading after the current one if point is not at BOL. If it is, it inserts the heading there with a trailing newline, pushing the old heading onto the next line. Of course, speed commands (like i) are invoked from BOL, so this always happens.
It's a very simple fix, just remove the
unless
statement and merge the newline creation into the main body of the function. But before I do that, I wanted to check why there is different behaviour for BOL at all? It seems such a strange exception that I thought it might be a protection for something specific that needs keeping. Basically, is there a good reason not to make the simple fix?