mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-11 21:03:05 +08:00
+ chagne: Word Wrap mode from WORD to SPACE to avoid wrapping at style change edges (bug in Scintilla ?)
This commit is contained in:
parent
c74ffc144b
commit
57307acd16
@ -6943,7 +6943,7 @@ BOOL FileVars_Apply(HWND hwnd,LPFILEVARS lpfv) {
|
||||
if (!bWordWrap)
|
||||
SendMessage(g_hwndEdit,SCI_SETWRAPMODE,SC_WRAP_NONE,0);
|
||||
else
|
||||
SendMessage(g_hwndEdit,SCI_SETWRAPMODE,(iWordWrapMode == 0) ? SC_WRAP_WORD : SC_WRAP_CHAR,0);
|
||||
SendMessage(g_hwndEdit,SCI_SETWRAPMODE,(iWordWrapMode == 0) ? SC_WRAP_WHITESPACE : SC_WRAP_CHAR,0);
|
||||
|
||||
if (lpfv->mask & FV_LONGLINESLIMIT)
|
||||
iLongLinesLimit = lpfv->iLongLinesLimit;
|
||||
|
||||
@ -1306,7 +1306,7 @@ LRESULT MsgCreate(HWND hwnd,WPARAM wParam,LPARAM lParam)
|
||||
if (!bWordWrap)
|
||||
SendMessage(g_hwndEdit,SCI_SETWRAPMODE,SC_WRAP_NONE,0);
|
||||
else
|
||||
SendMessage(g_hwndEdit,SCI_SETWRAPMODE,(iWordWrapMode == 0) ? SC_WRAP_WORD : SC_WRAP_CHAR,0);
|
||||
SendMessage(g_hwndEdit,SCI_SETWRAPMODE,(iWordWrapMode == 0) ? SC_WRAP_WHITESPACE : SC_WRAP_CHAR,0);
|
||||
|
||||
if (iWordWrapIndent == 5)
|
||||
SendMessage(g_hwndEdit,SCI_SETWRAPINDENTMODE,SC_WRAPINDENT_SAME,0);
|
||||
@ -4129,8 +4129,9 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
if (!bWordWrap)
|
||||
SendMessage(g_hwndEdit,SCI_SETWRAPMODE,SC_WRAP_NONE,0);
|
||||
else
|
||||
SendMessage(g_hwndEdit,SCI_SETWRAPMODE,(iWordWrapMode == 0) ? SC_WRAP_WORD : SC_WRAP_CHAR,0);
|
||||
SendMessage(g_hwndEdit,SCI_SETWRAPMODE,(iWordWrapMode == 0) ? SC_WRAP_WHITESPACE : SC_WRAP_CHAR,0);
|
||||
bWordWrapG = bWordWrap;
|
||||
//EditApplyLexerStyle(g_hwndEdit, 0, -1);
|
||||
UpdateToolbar();
|
||||
break;
|
||||
|
||||
@ -4139,7 +4140,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
if (WordWrapSettingsDlg(hwnd,IDD_WORDWRAP,&iWordWrapIndent))
|
||||
{
|
||||
if (bWordWrap)
|
||||
SendMessage(g_hwndEdit,SCI_SETWRAPMODE,(iWordWrapMode == 0) ? SC_WRAP_WORD : SC_WRAP_CHAR,0);
|
||||
SendMessage(g_hwndEdit,SCI_SETWRAPMODE,(iWordWrapMode == 0) ? SC_WRAP_WHITESPACE : SC_WRAP_CHAR,0);
|
||||
if (iWordWrapIndent == 5)
|
||||
SendMessage(g_hwndEdit,SCI_SETWRAPINDENTMODE,SC_WRAPINDENT_SAME,0);
|
||||
else if (iWordWrapIndent == 6)
|
||||
|
||||
16
src/Styles.c
16
src/Styles.c
@ -3732,12 +3732,14 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) {
|
||||
}
|
||||
|
||||
// apply lexer styles
|
||||
Style_SetUrlHotSpot(hwnd, TRUE);
|
||||
SendMessage(hwnd, SCI_COLOURISE, 0, (LPARAM)-1);
|
||||
Style_SetUrlHotSpot(hwnd, FALSE);
|
||||
EditApplyLexerStyle(g_hwndEdit, 0, -1);
|
||||
|
||||
// update UI for hotspots
|
||||
Style_SetUrlHotSpot(hwnd, bHyperlinkHotspot);
|
||||
EditUpdateUrlHotspots(hwnd, 0, SciCall_GetTextLength(), bHyperlinkHotspot);
|
||||
if (bHyperlinkHotspot) {
|
||||
Style_SetUrlHotSpot(hwnd, bHyperlinkHotspot);
|
||||
EditUpdateUrlHotspots(hwnd, 0, SciCall_GetTextLength(), bHyperlinkHotspot);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -3762,7 +3764,6 @@ void Style_SetUrlHotSpot(HWND hwnd, BOOL bHotSpot)
|
||||
|
||||
if (bHotSpot)
|
||||
{
|
||||
|
||||
const WCHAR* const lpszStyleHotSpot = GetCurrentStdLexer()->Styles[STY_URL_HOTSPOT].szValue;
|
||||
|
||||
SendMessage(hwnd, SCI_STYLESETHOTSPOT, iStyleHotSpot, (LPARAM)TRUE);
|
||||
@ -3791,11 +3792,8 @@ void Style_SetUrlHotSpot(HWND hwnd, BOOL bHotSpot)
|
||||
}
|
||||
}
|
||||
else {
|
||||
const WCHAR* lpszStyleHotSpot = GetCurrentStdLexer()->Styles[STY_DEFAULT].szValue;
|
||||
|
||||
const WCHAR* const lpszStyleHotSpot = GetCurrentStdLexer()->Styles[STY_DEFAULT].szValue;
|
||||
Style_SetStyles(hwnd, iStyleHotSpot, lpszStyleHotSpot);
|
||||
|
||||
SendMessage(hwnd, SCI_SETHOTSPOTSINGLELINE, TRUE, 0);
|
||||
SendMessage(hwnd, SCI_STYLESETHOTSPOT, iStyleHotSpot, (LPARAM)FALSE);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user