mirror of https://github.com/procxx/kepka.git
parent
0109ee2758
commit
da48a78f7c
|
@ -185,9 +185,9 @@ struct TagStartExpression {
|
||||||
constexpr auto kTagBoldIndex = 0;
|
constexpr auto kTagBoldIndex = 0;
|
||||||
constexpr auto kTagItalicIndex = 1;
|
constexpr auto kTagItalicIndex = 1;
|
||||||
//constexpr auto kTagUnderlineIndex = 2;
|
//constexpr auto kTagUnderlineIndex = 2;
|
||||||
//constexpr auto kTagStrikeOutIndex = 2;
|
constexpr auto kTagStrikeOutIndex = 2;
|
||||||
constexpr auto kTagCodeIndex = 2;
|
constexpr auto kTagCodeIndex = 3;
|
||||||
constexpr auto kTagPreIndex = 3;
|
constexpr auto kTagPreIndex = 4;
|
||||||
constexpr auto kInvalidPosition = std::numeric_limits<int>::max() / 2;
|
constexpr auto kInvalidPosition = std::numeric_limits<int>::max() / 2;
|
||||||
|
|
||||||
class TagSearchItem {
|
class TagSearchItem {
|
||||||
|
@ -310,13 +310,13 @@ const std::vector<TagStartExpression> &TagStartExpressions() {
|
||||||
// TextUtilities::MarkdownUnderlineBadAfter(),
|
// TextUtilities::MarkdownUnderlineBadAfter(),
|
||||||
// TextUtilities::MarkdownUnderlineGoodBefore()
|
// TextUtilities::MarkdownUnderlineGoodBefore()
|
||||||
//},
|
//},
|
||||||
//{
|
{
|
||||||
// kTagStrikeOut,
|
kTagStrikeOut,
|
||||||
// TextUtilities::MarkdownStrikeOutGoodBefore(),
|
TextUtilities::MarkdownStrikeOutGoodBefore(),
|
||||||
// TextUtilities::MarkdownStrikeOutBadAfter(),
|
TextUtilities::MarkdownStrikeOutBadAfter(),
|
||||||
// TextUtilities::MarkdownStrikeOutBadAfter(),
|
TextUtilities::MarkdownStrikeOutBadAfter(),
|
||||||
// QString(),
|
QString(),
|
||||||
//},
|
},
|
||||||
{
|
{
|
||||||
kTagCode,
|
kTagCode,
|
||||||
TextUtilities::MarkdownCodeGoodBefore(),
|
TextUtilities::MarkdownCodeGoodBefore(),
|
||||||
|
@ -340,7 +340,7 @@ const std::map<QString, int> &TagIndices() {
|
||||||
{ kTagBold, kTagBoldIndex },
|
{ kTagBold, kTagBoldIndex },
|
||||||
{ kTagItalic, kTagItalicIndex },
|
{ kTagItalic, kTagItalicIndex },
|
||||||
//{ kTagUnderline, kTagUnderlineIndex },
|
//{ kTagUnderline, kTagUnderlineIndex },
|
||||||
//{ kTagStrikeOut, kTagStrikeOutIndex },
|
{ kTagStrikeOut, kTagStrikeOutIndex },
|
||||||
{ kTagCode, kTagCodeIndex },
|
{ kTagCode, kTagCodeIndex },
|
||||||
{ kTagPre, kTagPreIndex },
|
{ kTagPre, kTagPreIndex },
|
||||||
};
|
};
|
||||||
|
@ -2743,10 +2743,10 @@ bool InputField::handleMarkdownKey(QKeyEvent *e) {
|
||||||
toggleSelectionMarkdown(kTagBold);
|
toggleSelectionMarkdown(kTagBold);
|
||||||
} else if (e == QKeySequence::Italic) {
|
} else if (e == QKeySequence::Italic) {
|
||||||
toggleSelectionMarkdown(kTagItalic);
|
toggleSelectionMarkdown(kTagItalic);
|
||||||
//} else if (e == QKeySequence::Underline) {
|
} else if (e == QKeySequence::Underline) {
|
||||||
// toggleSelectionMarkdown(kTagUnderline);
|
toggleSelectionMarkdown(kTagUnderline);
|
||||||
//} else if (matches(kStrikeOutSequence)) {
|
} else if (matches(kStrikeOutSequence)) {
|
||||||
// toggleSelectionMarkdown(kTagStrikeOut);
|
toggleSelectionMarkdown(kTagStrikeOut);
|
||||||
} else if (matches(kMonospaceSequence)) {
|
} else if (matches(kMonospaceSequence)) {
|
||||||
toggleSelectionMarkdown(kTagCode);
|
toggleSelectionMarkdown(kTagCode);
|
||||||
} else if (matches(kClearFormatSequence)) {
|
} else if (matches(kClearFormatSequence)) {
|
||||||
|
@ -3411,8 +3411,8 @@ void InputField::addMarkdownActions(
|
||||||
|
|
||||||
addtag(tr::lng_menu_formatting_bold(tr::now), QKeySequence::Bold, kTagBold);
|
addtag(tr::lng_menu_formatting_bold(tr::now), QKeySequence::Bold, kTagBold);
|
||||||
addtag(tr::lng_menu_formatting_italic(tr::now), QKeySequence::Italic, kTagItalic);
|
addtag(tr::lng_menu_formatting_italic(tr::now), QKeySequence::Italic, kTagItalic);
|
||||||
//addtag(tr::lng_menu_formatting_underline(tr::now), QKeySequence::Underline, kTagUnderline);
|
addtag(tr::lng_menu_formatting_underline(tr::now), QKeySequence::Underline, kTagUnderline);
|
||||||
//addtag(tr::lng_menu_formatting_strike_out(tr::now), kStrikeOutSequence, kTagStrikeOut);
|
addtag(tr::lng_menu_formatting_strike_out(tr::now), kStrikeOutSequence, kTagStrikeOut);
|
||||||
addtag(tr::lng_menu_formatting_monospace(tr::now), kMonospaceSequence, kTagCode);
|
addtag(tr::lng_menu_formatting_monospace(tr::now), kMonospaceSequence, kTagCode);
|
||||||
|
|
||||||
if (_editLinkCallback) {
|
if (_editLinkCallback) {
|
||||||
|
|
Loading…
Reference in New Issue