Skip to content

Commit

Permalink
+ chg: changed initial factory defaults for some settings
Browse files Browse the repository at this point in the history
+ minor bug fixes
  • Loading branch information
RaiKoHoff committed Oct 3, 2018
1 parent 59c07a1 commit c320728
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 35 deletions.
24 changes: 7 additions & 17 deletions src/Edit.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
#include "SciCall.h"
#include "scilexer.h"

#include "edit.h"
#include "Edit.h"


#ifndef LCMAP_TITLECASE
Expand Down Expand Up @@ -6307,12 +6307,14 @@ void EditClearAllOccurrenceMarkers(HWND hwnd)
{
_IGNORE_NOTIFY_CHANGE_;

SendMessage(hwnd, SCI_SETINDICATORCURRENT, INDIC_NP3_MARK_OCCURANCE, 0);
SendMessage(hwnd, SCI_INDICATORCLEARRANGE, 0, SciCall_GetTextLength());
SciCall_SetIndicatorCurrent(INDIC_NP3_MARK_OCCURANCE);
SciCall_IndicatorClearRange(0, SciCall_GetTextLength());
_DeleteLineStateAll(LINESTATE_OCCURRENCE_MARK);
g_iMarkOccurrencesCount = (Settings.MarkOccurrences > 0) ? 0 : -1;
EditFinalizeStyling(hwnd, -1);

_OBSERVE_NOTIFY_CHANGE_;

g_iMarkOccurrencesCount = (Settings.MarkOccurrences > 0) ? 0 : -1;
}
}

Expand Down Expand Up @@ -6448,7 +6450,7 @@ void EditMarkAll(HWND hwnd, char* pszFind, int flags, DocPos rangeStart, DocPos
DocPos start = rangeStart;
DocPos end = rangeEnd;

SendMessage(hwnd, SCI_SETINDICATORCURRENT, INDIC_NP3_MARK_OCCURANCE, 0);
SciCall_SetIndicatorCurrent(INDIC_NP3_MARK_OCCURANCE);

g_iMarkOccurrencesCount = 0;
DocPos iPos = (DocPos)-1;
Expand Down Expand Up @@ -6899,18 +6901,6 @@ static bool _HighlightIfBrace(HWND hwnd, DocPos iPos)
}


//=============================================================================
//
// EditApplyLexerStyle()
// if iRangeEnd == -1 : apply style from iRangeStart to document end
//
void EditApplyLexerStyle(HWND hwnd, DocPos iRangeStart, DocPos iRangeEnd)
{
UNUSED(hwnd);
SciCall_Colourise(iRangeStart, iRangeEnd);
}


//=============================================================================
//
// EditFinalizeStyling()
Expand Down
9 changes: 6 additions & 3 deletions src/Edit.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#define _NP3_EDIT_H_

#include "Scintilla.h"
#include "SciCall.h"
#include "TypeDefs.h"

// extern "C" declarations of Scintilla functions
Expand Down Expand Up @@ -107,15 +108,17 @@ void EditSetAccelWordNav(HWND,bool);
bool EditAutoCompleteWord(HWND,bool);
void EditGetBookmarkList(HWND,LPWSTR,int);
void EditSetBookmarkList(HWND,LPCWSTR);
void EditApplyLexerStyle(HWND, DocPos, DocPos);
void EditFinalizeStyling(HWND, DocPos);

void EditMarkAllOccurrences(HWND hwnd, bool bForceClear);
void EditUpdateVisibleUrlHotspot(bool);
void EditHideNotMarkedLineRange(HWND, DocPos, DocPos, bool);

//void SciInitThemes(HWND);
//LRESULT CALLBACK SciThemedWndProc(HWND,UINT,WPARAM,LPARAM);
// if iRangeEnd == -1 : apply style from iRangeStart to document end
inline void EditApplyLexerStyle(HWND hwnd, const DocPos iRangeStart, const DocPos iRangeEnd) {
(void)(hwnd); SciCall_Colourise(iRangeStart, iRangeEnd);
}


#define FV_TABWIDTH 1
#define FV_INDENTWIDTH 2
Expand Down
4 changes: 2 additions & 2 deletions src/Encoding.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
* Encoding.c *
* Handling and Helpers for File Encoding *
* Based on code from Notepad2, (c) Florian Balmer 1996-2011 *
* *
* *
* *
* *
* *
* (c) Rizonesoft 2015-2018 *
* https://rizonesoft.com *
Expand Down
14 changes: 7 additions & 7 deletions src/Notepad3.c
Original file line number Diff line number Diff line change
Expand Up @@ -6722,7 +6722,7 @@ void LoadSettings()
Settings.EFR_Data.bTransformBS = IniSectionGetBool(pIniSection, L"FindTransformBS", Defaults.EFR_Data.bTransformBS);
Defaults.EFR_Data.bWildcardSearch = false;
Settings.EFR_Data.bWildcardSearch = IniSectionGetBool(pIniSection, L"WildcardSearch", Defaults.EFR_Data.bWildcardSearch);
Defaults.EFR_Data.bMarkOccurences = false;
Defaults.EFR_Data.bMarkOccurences = true;
Settings.EFR_Data.bMarkOccurences = IniSectionGetBool(pIniSection, L"FindMarkAllOccurrences", Defaults.EFR_Data.bMarkOccurences);
Defaults.EFR_Data.bHideNonMatchedLines = false;
Settings.EFR_Data.bHideNonMatchedLines = IniSectionGetBool(pIniSection, L"HideNonMatchedLines", Defaults.EFR_Data.bHideNonMatchedLines);
Expand Down Expand Up @@ -6753,17 +6753,17 @@ void LoadSettings()
GET_INT_VALUE_FROM_INISECTION(PathNameFormat, 1, 0, 2);
GET_BOOL_VALUE_FROM_INISECTION(WordWrap, false); g_bWordWrapG = Settings.WordWrap;
GET_INT_VALUE_FROM_INISECTION(WordWrapMode, 0, 0, 1);
GET_INT_VALUE_FROM_INISECTION(WordWrapIndent, 0, 0, 6);
GET_INT_VALUE_FROM_INISECTION(WordWrapIndent, 2, 0, 6);

Defaults.WordWrapSymbols = 22;
int iWS = IniSectionGetInt(pIniSection, L"WordWrapSymbols", Defaults.WordWrapSymbols);
int const iWS = IniSectionGetInt(pIniSection, L"WordWrapSymbols", Defaults.WordWrapSymbols);
Settings.WordWrapSymbols = clampi(iWS % 10, 0, 2) + clampi((iWS % 100 - iWS % 10) / 10, 0, 2) * 10;

GET_BOOL_VALUE_FROM_INISECTION(ShowWordWrapSymbols, false);
GET_BOOL_VALUE_FROM_INISECTION(ShowWordWrapSymbols, true);
GET_BOOL_VALUE_FROM_INISECTION(MatchBraces, true);
GET_BOOL_VALUE_FROM_INISECTION(AutoCloseTags, false);
GET_BOOL_VALUE_FROM_INISECTION(HighlightCurrentLine, false);
GET_BOOL_VALUE_FROM_INISECTION(HyperlinkHotspot, false);
GET_BOOL_VALUE_FROM_INISECTION(HighlightCurrentLine, true);
GET_BOOL_VALUE_FROM_INISECTION(HyperlinkHotspot, true);
GET_BOOL_VALUE_FROM_INISECTION(ScrollPastEOF, false);
GET_BOOL_VALUE_FROM_INISECTION(AutoIndent, true);
GET_BOOL_VALUE_FROM_INISECTION(AutoCompleteWords, false);
Expand All @@ -6784,7 +6784,7 @@ void LoadSettings()
GET_INT_VALUE_FROM_INISECTION(MarkOccurrences, 1, 0, 3);
GET_BOOL_VALUE_FROM_INISECTION(MarkOccurrencesMatchVisible, false);
GET_BOOL_VALUE_FROM_INISECTION(MarkOccurrencesMatchCase, false);
GET_BOOL_VALUE_FROM_INISECTION(MarkOccurrencesMatchWholeWords, false);
GET_BOOL_VALUE_FROM_INISECTION(MarkOccurrencesMatchWholeWords, true);

Defaults.MarkOccurrencesCurrentWord = !Defaults.MarkOccurrencesMatchWholeWords;
Settings.MarkOccurrencesCurrentWord = IniSectionGetBool(pIniSection, L"MarkOccurrencesCurrentWord", Defaults.MarkOccurrencesCurrentWord);
Expand Down
2 changes: 2 additions & 0 deletions src/SciCall.h
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,10 @@ DeclareSciCallR0(GetMaxLineState, GETMAXLINESTATE, DocLn)
//
// Indicators
//
DeclareSciCallV1(SetIndicatorCurrent, SETINDICATORCURRENT, int, indicatorID)
DeclareSciCallR2(IndicatorValueAt, INDICATORVALUEAT, int, int, indicatorID, DocPos, position)
DeclareSciCallV2(IndicatorFillRange, INDICATORFILLRANGE, DocPos, position, DocPos, length)
DeclareSciCallV2(IndicatorClearRange, INDICATORCLEARRANGE, DocPos, position, DocPos, length)


//=============================================================================
Expand Down
12 changes: 6 additions & 6 deletions src/StyleLexers/styleLexStandard.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ EDITLEXER lexStandard = {
SCLEX_NULL, IDS_LEX_DEF_TXT, L"Default Text", L"txt; text; wtx; log; asc; doc", L"",
&StdLexFunction, // static
&KeyWords_NULL, {
/* 0 */ { STYLE_DEFAULT, IDS_LEX_STD_STYLE, L"Default Style", L"font:Default; size:10", L"" },
/* 1 */ { STYLE_LINENUMBER, IDS_LEX_STD_MARGIN, L"Margins and Line Numbers", L"size:-2; fore:#FF0000", L"" },
/* 2 */ { STYLE_BRACELIGHT, IDS_LEX_STD_BRACE, L"Matching Braces (Indicator)", L"fore:#00FF40; alpha:40; alpha2:40; indic_roundbox", L"" },
/* 0 */ { STYLE_DEFAULT, IDS_LEX_STD_STYLE, L"Default Style", L"font:Default; size:11", L"" },
/* 1 */ { STYLE_LINENUMBER, IDS_LEX_STD_MARGIN, L"Margins and Line Numbers", L"size:-2; fore:#008080", L"" },
/* 2 */ { STYLE_BRACELIGHT, IDS_LEX_STD_BRACE, L"Matching Braces (Indicator)", L"fore:#00FF40; alpha:80; alpha2:80; indic_roundbox", L"" },
/* 3 */ { STYLE_BRACEBAD, IDS_LEX_STD_BRACE_FAIL, L"Matching Braces Error (Indicator)", L"fore:#FF0080; alpha:140; alpha2:140; indic_roundbox", L"" },
/* 4 */ { STYLE_CONTROLCHAR, IDS_LEX_STD_CTRL_CHAR, L"Control Characters (Font)", L"size:-1", L"" },
/* 5 */ { STYLE_INDENTGUIDE, IDS_LEX_STD_INDENT, L"Indentation Guide (Color)", L"fore:#A0A0A0", L"" },
/* 6 */ { SCI_SETSELFORE+SCI_SETSELBACK, IDS_LEX_STD_SEL, L"Selected Text (Colors)", L"back:#0A246A; eolfilled; alpha:95", L"" },
/* 6 */ { SCI_SETSELFORE+SCI_SETSELBACK, IDS_LEX_STD_SEL, L"Selected Text (Colors)", L"back:#4040FF; eolfilled; alpha:80", L"" },
/* 7 */ { SCI_SETWHITESPACEFORE+SCI_SETWHITESPACEBACK+SCI_SETWHITESPACESIZE, IDS_LEX_STD_WSPC, L"Whitespace (Colors, Size 0-12)", L"fore:#FF4000", L"" },
/* 8 */ { SCI_SETCARETLINEBACK, IDS_LEX_STD_LN_BACKGR, L"Current Line Background (Color)", L"back:#FFFF00; alpha:50", L"" },
/* 9 */ { SCI_SETCARETFORE+SCI_SETCARETWIDTH, IDS_LEX_STD_CARET, L"Caret (Color, Size 1-3)", L"", L"" },
Expand All @@ -58,8 +58,8 @@ EDITLEXER lexStandard2nd = {
SCLEX_NULL, IDS_LEX_STR_63266, L"2nd Default Text", L"txt; text; wtx; log; asc; doc", L"",
&Std2ndLexFunction, // static
&KeyWords_NULL,{
/* 0 */ { STYLE_DEFAULT, IDS_LEX_2ND_STYLE, L"2nd Default Style", L"font:Courier New; size:10", L"" },
/* 1 */ { STYLE_LINENUMBER, IDS_LEX_2ND_MARGIN, L"2nd Margins and Line Numbers", L"font:Tahoma; size:-2; fore:#FF0000", L"" },
/* 0 */ { STYLE_DEFAULT, IDS_LEX_2ND_STYLE, L"2nd Default Style", L"font:Courier New; size:11", L"" },
/* 1 */ { STYLE_LINENUMBER, IDS_LEX_2ND_MARGIN, L"2nd Margins and Line Numbers", L"font:Courier New; size:-2; fore:#008080", L"" },
/* 2 */ { STYLE_BRACELIGHT, IDS_LEX_2ND_BRACE, L"2nd Matching Braces (Indicator)", L"fore:#00FF40; alpha:80; alpha2:220; indic_roundbox", L"" },
/* 3 */ { STYLE_BRACEBAD, IDS_LEX_2ND_BRACE_FAIL, L"2nd Matching Braces Error (Indicator)", L"fore:#FF0080; alpha:140; alpha2:220; indic_roundbox", L"" },
/* 4 */ { STYLE_CONTROLCHAR, IDS_LEX_2ND_CTRL_CHAR, L"2nd Control Characters (Font)", L"size:-1", L"" },
Expand Down
Binary file modified src/Version.h
Binary file not shown.

0 comments on commit c320728

Please sign in to comment.