summaryrefslogtreecommitdiff
path: root/plugins/NewStory
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-12-05 12:12:43 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-12-05 12:12:43 +0300
commit67de1ebbc6d3ff8c9e67d4d796de0d4df8301b6f (patch)
tree5b2c35adbea46efe65ba6877745a14890fdb5f91 /plugins/NewStory
parent436b606226fea6dd7ca03fc36f55fab53ce3bfb7 (diff)
fixes #4012 (NewStory: при редактировании переносы строк пропадают)
Diffstat (limited to 'plugins/NewStory')
-rw-r--r--plugins/NewStory/src/history_control.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp
index 60687e79df..cd25eb3cca 100644
--- a/plugins/NewStory/src/history_control.cpp
+++ b/plugins/NewStory/src/history_control.cpp
@@ -229,8 +229,13 @@ void NewstoryListData::BeginEditItem()
int fontid, colorid;
item->getFontColor(fontid, colorid);
+ // #4012 make sure that both single & double CRLF are now double
+ CMStringW wszText(item->getWBuf());
+ wszText.Replace(L"\r\n", L"\n");
+ wszText.Replace(L"\n", L"\r\n");
+
uint32_t dwStyle = WS_CHILD | WS_BORDER | ES_MULTILINE | ES_AUTOVSCROLL;
- hwndEditBox = CreateWindow(L"EDIT", item->getWBuf(), dwStyle, 0, top, rc.right - rc.left, itemHeight, m_hwnd, NULL, g_plugin.getInst(), NULL);
+ hwndEditBox = CreateWindow(L"EDIT", wszText, dwStyle, 0, top, rc.right - rc.left, itemHeight, m_hwnd, NULL, g_plugin.getInst(), NULL);
mir_subclassWindow(hwndEditBox, HistoryEditWndProc);
SendMessage(hwndEditBox, WM_SETFONT, (WPARAM)g_fontTable[fontid].hfnt, 0);
SendMessage(hwndEditBox, EM_SETMARGINS, EC_RIGHTMARGIN, 100);