Differing behavior with () vs ##
CompletedWhen I type an open paren (, nvUltra auto-adds the closing paren right away and if I type a closing paren, it "matches" the auto-added one, so I only end up with one closing paren.
When I type a section heading hash ("#", "##" etc), nothing is auto-added until I hit return, and if I type the closing hash myself and then hit return, I end up with unwanted double hashes ("# #<cr>").
Would prefer behavior for heading hashes to match that of parens.
Thanks!
-
What steps do you take to get doubling up of hashes? I cannot replicate.
0 -
Cmd-L Foo <CR>
# Foo #<CR>Result: upon hitting second return, nvUltra adds a space and a hash, resulting in:
# Foo # #
Running 2021.09.30.13.09, Check updates does not find newer, on Catalina 10.15.7
0 -
Can you post a screenshot of your Editing preferences?
0 -

I had previously (when trying to change this behavior) added ## to the smart pairs, but iirc it didn't change the behavior.
I'd forgotten when posting this about the "Append '#' to end of headings"-setting. I suppose I could have written this as "I want that to add a '#' only if I didn't already type one." Seeing the two separate setting explains that headings work differently than "smart pairs" do--I'd like them to work more the same, with the exception of which side of the CR the closing symbol goes--with parens, the closing paren is after the newline; you want the closing hash before the newline.
Also, I noticed this difference depending on presence of a space after the opening symbol. Maybe I misunderstand the mental model; this isn't what I expected.
Type
#Foo<CR>
Get
#Foo
Type
# Foo<CR>
Get:
# Foo #
Type
(Foo<CR>
get:
(Foo
)Type
( Foo<CR>
get:
( Foo
0 -
It looks like it's a regression when the Title Case is turned off. Turn that on and `#` should work properly. I'll fix.
0 -
Yes, that helps, thanks.
It still feels odd that hitting space after an open-paren kills the smart-added closer, but with headings it works the other way around: "# foo" gets you a closer upon CR but "#foo" does not.
0 -
`#foo` is not a header. The space is required for a header to be recognized. This is one of the very few intentional differences between MultiMarkdown v6 and Markdown.pl, though it is consistent with the behavior of CommonMark (for what that is worth).
(As an aside, smart pairs must be entered in pairs, as the name would suggest. The single trailing `#` in your preferences doesn't accomplish anything.)
0 -
Fixed for upcoming release.
0
Please sign in to leave a comment.
Comments
8 comments