Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion locales/en.catkeys
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
1 English x-vnd.KapiX-Koder 519025525
1 English x-vnd.KapiX-Koder 2883905919
Something wrong has happened while opening the configuration file. Your personal settings will not be %s%. Preferences Something wrong has happened while opening the configuration file. Your personal settings will not be %s%.
Access denied EditorWindow Access denied
Line endings EditorWindow Line endings
Use custom font AppPreferencesWindow Use custom font
In selection FindWindow In selection
About… EditorWindow About…
Allow scrolling past end of file AppPreferencesWindow Allow scrolling past end of file
The file contains unsaved changes. What to do? EditorWindow The file contains unsaved changes. What to do?
Replace: FindWindow Replace:
Cancel QuitAlert Cancel
Expand Down
1 change: 1 addition & 0 deletions src/editor/EditorWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1310,6 +1310,7 @@ EditorWindow::_SyncWithPreferences()
fEditor->SendMessage(SCI_SETCARETLINEFRAME, fPreferences->fLineHighlightingMode ? 2 : 0);
fEditor->SendMessage(SCI_SETCARETSTYLE,
fPreferences->fUseBlockCursor ? (CARETSTYLE_BLOCK | CARETSTYLE_BLOCK_AFTER) : CARETSTYLE_LINE, 0);
fEditor->SendMessage(SCI_SETENDATLASTLINE, !fPreferences->fScrollPastEndOfFile);

if(fFilePreferences.fEOLMode) {
fEditor->SendMessage(SCI_SETEOLMODE, fFilePreferences.fEOLMode.value_or(SC_EOL_LF), 0);
Expand Down
7 changes: 7 additions & 0 deletions src/preferences/AppPreferencesWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@ AppPreferencesWindow::MessageReceived(BMessage* message)
fPreferences->fFontSize = fFontSizeSpinner->Value();
_PreferencesModified();
} break;
case Actions::SCROLL_PAST_END: {
fPreferences->fScrollPastEndOfFile = IsChecked(fScrollPastEndCB);
_PreferencesModified();
} break;
case Actions::REVERT: {
*fPreferences = *fStartPreferences;
_PreferencesModified();
Expand Down Expand Up @@ -342,6 +346,7 @@ AppPreferencesWindow::_InitInterface()

fBracesHighlightingCB = new BCheckBox("bracesHighlighting", B_TRANSLATE("Highlight braces"), new BMessage((uint32) Actions::BRACES_HIGHLIGHTING));
fBlockCursorCB = new BCheckBox("blockCursor", B_TRANSLATE("Use block cursor"), new BMessage((uint32) Actions::BLOCK_CURSOR));
fScrollPastEndCB = new BCheckBox("scrollPastEnd", B_TRANSLATE("Allow scrolling past end of file"), new BMessage((uint32) Actions::SCROLL_PAST_END));

fEditorStyleMenu = new BPopUpMenu("style");
fEditorStyleMF = new BMenuField("style", B_TRANSLATE("Style"), fEditorStyleMenu);
Expand Down Expand Up @@ -381,6 +386,7 @@ AppPreferencesWindow::_InitInterface()
.Add(fFullPathInTitleCB)
.Add(fBracesHighlightingCB)
.Add(fBlockCursorCB)
.Add(fScrollPastEndCB)
.Add(fToolbarBox)
.AddStrut(B_USE_HALF_ITEM_SPACING)
.Add(fLineLimitBox)
Expand Down Expand Up @@ -487,6 +493,7 @@ AppPreferencesWindow::_SyncPreferences(Preferences* preferences)

SetChecked(fBracesHighlightingCB, preferences->fBracesHighlighting);
SetChecked(fBlockCursorCB, preferences->fUseBlockCursor);
SetChecked(fScrollPastEndCB, preferences->fScrollPastEndOfFile);
SetChecked(fAttachNewWindowsCB, preferences->fOpenWindowsInStack);
SetChecked(fHighlightTrailingWSCB, preferences->fHighlightTrailingWhitespace);
SetChecked(fTrimTrailingWSOnSaveCB, preferences->fTrimTrailingWhitespaceOnSave);
Expand Down
2 changes: 2 additions & 0 deletions src/preferences/AppPreferencesWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class AppPreferencesWindow : public BWindow {
USE_CUSTOM_FONT = 'ucfn',
FONT_CHANGED = 'fnch',
FONT_SIZE_CHANGED = 'fsch',
SCROLL_PAST_END = 'scpe',

REVERT = 'rvrt'
};
Expand Down Expand Up @@ -138,6 +139,7 @@ class AppPreferencesWindow : public BWindow {

BCheckBox* fBracesHighlightingCB;
BCheckBox* fBlockCursorCB;
BCheckBox* fScrollPastEndCB;

BPopUpMenu* fEditorStyleMenu;
BMenuField* fEditorStyleMF;
Expand Down
3 changes: 3 additions & 0 deletions src/preferences/Preferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ Preferences::Load(const char* filename)
fUseEditorconfig = storage.GetBool("useEditorconfig", true);
fAlwaysOpenInNewWindow = storage.GetBool("alwaysOpenInNewWindow", false);
fUseCustomFont = storage.GetBool("useCustomFont", false);
fScrollPastEndOfFile = storage.GetBool("scrollPastEndOfFile", false);
fFontFamily = storage.GetString("fontFamily", "Noto Sans Mono");
fFontSize = storage.GetUInt8("fontSize", 12);
fToolbarIconSizeMultiplier = storage.GetUInt8("toolbarIconSizeMultiplier", 3);
Expand Down Expand Up @@ -162,6 +163,7 @@ Preferences::Save(const char* filename)
storage.AddBool("alwaysOpenInNewWindow", fAlwaysOpenInNewWindow);
storage.AddBool("useEditorconfig", fUseEditorconfig);
storage.AddBool("useCustomFont", fUseCustomFont);
storage.AddBool("scrollPastEndOfFile", fScrollPastEndOfFile);
storage.AddString("fontFamily", fFontFamily.c_str());
storage.AddUInt8("fontSize", fFontSize);
storage.AddUInt8("toolbarIconSizeMultiplier", fToolbarIconSizeMultiplier);
Expand Down Expand Up @@ -206,6 +208,7 @@ Preferences::operator =(Preferences& p)
fFindWindowState = p.fFindWindowState;
fAlwaysOpenInNewWindow = p.fAlwaysOpenInNewWindow;
fUseCustomFont = p.fUseCustomFont;
fScrollPastEndOfFile = p.fScrollPastEndOfFile;
fFontFamily = p.fFontFamily;
fFontSize = p.fFontSize;
fToolbarIconSizeMultiplier = p.fToolbarIconSizeMultiplier;
Expand Down
1 change: 1 addition & 0 deletions src/preferences/Preferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class Preferences {
bool fUseEditorconfig;
bool fAlwaysOpenInNewWindow;
bool fUseCustomFont;
bool fScrollPastEndOfFile;
std::string fFontFamily;
uint8 fFontSize;
uint8 fToolbarIconSizeMultiplier;
Expand Down