Allow setting a code block on a line that already has text (it will start a newline for the codeblock)
This commit is contained in:
parent
b925d2e89e
commit
0a64dc525d
2 changed files with 5 additions and 2 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
* Add .desktop file for Debian
|
||||
* Fix Pomodoro timer rounding so it rounds up to 0.25, but rounds to closest quarter (up or down) for minutes higher than that, instead of always up to next quarter.
|
||||
* Allow setting a code block on a line that already has text (it will start a newline for the codeblock)
|
||||
|
||||
# 0.7.5
|
||||
|
||||
|
|
|
|||
|
|
@ -919,8 +919,10 @@ class MarkdownEditor(QTextEdit):
|
|||
before = line[:pos_in_block]
|
||||
|
||||
# "before" currently contains whatever's before the *third* backtick.
|
||||
# We trigger only when the line is (whitespace + "``") before the caret.
|
||||
if before.endswith("``") and before.strip() == "``":
|
||||
# Trigger when the user types a *third consecutive* backtick anywhere on the line.
|
||||
# (We require the run immediately before the caret to be exactly two backticks,
|
||||
# so we don't trigger on 4+ backticks.)
|
||||
if before.endswith("``") and (len(before) < 3 or before[-3] != "`"):
|
||||
doc = self.document()
|
||||
if doc is not None:
|
||||
# Remove the two backticks that were already typed
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue