Skip to content

Commit

Permalink
Support new SC_WRAPINDENT_DEEPINDENT wrap mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
zufuliu committed Jul 8, 2018
1 parent f6b2dce commit 906f182
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/Notepad2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1437,6 +1437,8 @@ LRESULT MsgCreate(HWND hwnd, WPARAM wParam, LPARAM lParam) {
SendMessage(hwndEdit, SCI_SETWRAPINDENTMODE, SC_WRAPINDENT_SAME, 0);
} else if (iWordWrapIndent == 6) {
SendMessage(hwndEdit, SCI_SETWRAPINDENTMODE, SC_WRAPINDENT_INDENT, 0);
} else if (iWordWrapIndent == 7) {
SendMessage(hwndEdit, SCI_SETWRAPINDENTMODE, SC_WRAPINDENT_DEEPINDENT, 0);
} else {
int i = 0;
switch (iWordWrapIndent) {
Expand Down Expand Up @@ -3672,6 +3674,8 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam) {
SendMessage(hwndEdit, SCI_SETWRAPINDENTMODE, SC_WRAPINDENT_SAME, 0);
} else if (iWordWrapIndent == 6) {
SendMessage(hwndEdit, SCI_SETWRAPINDENTMODE, SC_WRAPINDENT_INDENT, 0);
} else if (iWordWrapIndent == 7) {
SendMessage(hwndEdit, SCI_SETWRAPINDENTMODE, SC_WRAPINDENT_DEEPINDENT, 0);
} else {
int i = 0;
switch (iWordWrapIndent) {
Expand Down Expand Up @@ -5204,7 +5208,7 @@ void LoadSettings(void) {
iWordWrapMode = clamp_i(iWordWrapMode, 0, 1);

iWordWrapIndent = IniSectionGetInt(pIniSection, L"WordWrapIndent", 0);
iWordWrapIndent = clamp_i(iWordWrapIndent, 0, 6);
iWordWrapIndent = clamp_i(iWordWrapIndent, 0, 7);

iWordWrapSymbols = IniSectionGetInt(pIniSection, L"WordWrapSymbols", 22);
iWordWrapSymbols = clamp_i(iWordWrapSymbols % 10, 0, 2) + clamp_i((iWordWrapSymbols % 100 - iWordWrapSymbols % 10) / 10, 0, 2) * 10;
Expand Down
2 changes: 1 addition & 1 deletion src/Notepad2.rc
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,7 @@ BEGIN
COMBOBOX 103,7,58,236,196,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
DEFPUSHBUTTON "OK",IDOK,83,79,50,14
PUSHBUTTON "Cancel",IDCANCEL,193,79,50,14
LTEXT "No wrap indent|Wrap indent by 1 character|Wrap indent by 2 characters|Wrap indent by 1 level|Wrap indent by 2 levels|Wrap indent as first subline|Wrap indent 1 level more than first subline",200,0,0,615,8,NOT WS_VISIBLE
LTEXT "No wrap indent|Wrap indent by 1 character|Wrap indent by 2 characters|Wrap indent by 1 level|Wrap indent by 2 levels|Wrap indent as first subline|Wrap indent 1 level more than first subline|Wrap indent 2 levels more than first subline",200,0,0,615,8,NOT WS_VISIBLE
LTEXT "No visual indicators before wrap|Show visual indicators before wrap (near text)|Show visual indicators before wrap (near borders)",201,0,0,418,8,NOT WS_VISIBLE
LTEXT "No visual indicators after wrap|Show visual indicators after wrap (near text)|Show visual indicators after wrap (near borders)",202,0,0,402,8,NOT WS_VISIBLE
LTEXT "Wrap text between words|Wrap text between any glyphs",203,0,0,187,8,NOT WS_VISIBLE
Expand Down

0 comments on commit 906f182

Please sign in to comment.