Skip to content

Commit

Permalink
Only enable the ".LOG" feature when file starts with all upper case "…
Browse files Browse the repository at this point in the history
….LOG". See issue XhmikosR/notepad2-mod#198.
  • Loading branch information
zufuliu committed Jul 29, 2018
1 parent 234dd78 commit a9e0e16
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Notepad2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1286,7 +1286,7 @@ LRESULT CALLBACK MainWndProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
else if (SendMessage(hwndEdit, SCI_GETLENGTH, 0, 0) >= 4) {
char tch[5] = "";
SendMessage(hwndEdit, SCI_GETTEXT, 5, (LPARAM)tch);
if (lstrcmpiA(tch, ".LOG") != 0) {
if (StrCmp(tch, ".LOG") != 0) {
int iNewTopLine;
SendMessage(hwndEdit, SCI_SETSEL, iAnchorPos, iCurPos);
SendMessage(hwndEdit, SCI_ENSUREVISIBLE, (WPARAM)iDocTopLine, 0);
Expand Down Expand Up @@ -2356,7 +2356,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam) {
if (SendMessage(hwndEdit, SCI_GETLENGTH, 0, 0) >= 4) {
char tch[5] = "";
SendMessage(hwndEdit, SCI_GETTEXT, 5, (LPARAM)tch);
if (lstrcmpiA(tch, ".LOG") != 0) {
if (StrCmp(tch, ".LOG") != 0) {
int iNewTopLine;
SendMessage(hwndEdit, SCI_SETSEL, iAnchorPos, iCurPos);
SendMessage(hwndEdit, SCI_ENSUREVISIBLE, (WPARAM)iDocTopLine, 0);
Expand Down Expand Up @@ -6926,7 +6926,7 @@ BOOL FileLoad(BOOL bDontSave, BOOL bNew, BOOL bReload, BOOL bNoEncDetect, LPCWST
if (SendMessage(hwndEdit, SCI_GETLENGTH, 0, 0) >= 4) {
char tchLog[5] = "";
SendMessage(hwndEdit, SCI_GETTEXT, 5, (LPARAM)tchLog);
if (lstrcmpiA(tchLog, ".LOG") == 0) {
if (StrCmp(tchLog, ".LOG") == 0) {
EditJumpTo(hwndEdit, -1, 0);
SendMessage(hwndEdit, SCI_BEGINUNDOACTION, 0, 0);
SendMessage(hwndEdit, SCI_NEWLINE, 0, 0);
Expand Down

0 comments on commit a9e0e16

Please sign in to comment.