diff --git a/locales/en.catkeys b/locales/en.catkeys index 73179fb..ab56d40 100644 --- a/locales/en.catkeys +++ b/locales/en.catkeys @@ -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 diff --git a/src/editor/EditorWindow.cpp b/src/editor/EditorWindow.cpp index 9f65c3a..1d6244f 100644 --- a/src/editor/EditorWindow.cpp +++ b/src/editor/EditorWindow.cpp @@ -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); diff --git a/src/preferences/AppPreferencesWindow.cpp b/src/preferences/AppPreferencesWindow.cpp index c5b6001..80c0e8d 100644 --- a/src/preferences/AppPreferencesWindow.cpp +++ b/src/preferences/AppPreferencesWindow.cpp @@ -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(); @@ -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); @@ -381,6 +386,7 @@ AppPreferencesWindow::_InitInterface() .Add(fFullPathInTitleCB) .Add(fBracesHighlightingCB) .Add(fBlockCursorCB) + .Add(fScrollPastEndCB) .Add(fToolbarBox) .AddStrut(B_USE_HALF_ITEM_SPACING) .Add(fLineLimitBox) @@ -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); diff --git a/src/preferences/AppPreferencesWindow.h b/src/preferences/AppPreferencesWindow.h index 64eb9e3..358146e 100644 --- a/src/preferences/AppPreferencesWindow.h +++ b/src/preferences/AppPreferencesWindow.h @@ -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' }; @@ -138,6 +139,7 @@ class AppPreferencesWindow : public BWindow { BCheckBox* fBracesHighlightingCB; BCheckBox* fBlockCursorCB; + BCheckBox* fScrollPastEndCB; BPopUpMenu* fEditorStyleMenu; BMenuField* fEditorStyleMF; diff --git a/src/preferences/Preferences.cpp b/src/preferences/Preferences.cpp index 3589c3f..f7f62ea 100644 --- a/src/preferences/Preferences.cpp +++ b/src/preferences/Preferences.cpp @@ -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); @@ -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); @@ -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; diff --git a/src/preferences/Preferences.h b/src/preferences/Preferences.h index b6ded97..c5bf30e 100644 --- a/src/preferences/Preferences.h +++ b/src/preferences/Preferences.h @@ -59,6 +59,7 @@ class Preferences { bool fUseEditorconfig; bool fAlwaysOpenInNewWindow; bool fUseCustomFont; + bool fScrollPastEndOfFile; std::string fFontFamily; uint8 fFontSize; uint8 fToolbarIconSizeMultiplier;