Side Panel right click context menu improvements (SpartanJ/ecode#712).

Side Panel: Right click on a sub-directory and "Find in folder..." (SpartanJ/ecode#720).
File Save now defaults to the most recent save location (SpartanJ/ecode#734).
Side Panel: right click on a directory and open it on new window (SpartanJ/ecode#736).
Build and Run: fix run in terminal on Windows 8.1 (SpartanJ/ecode#740).
This commit is contained in:
Martín Lucas Golini
2025-12-07 00:24:04 -03:00
parent ab738ea79d
commit 1cd943ae26
15 changed files with 112 additions and 48 deletions

View File

@@ -546,7 +546,9 @@ UIFileDialog* App::saveFileDialog( UICodeEditor* editor, bool focusOnClose ) {
std::string filename( editor->getDocument().getFilename() );
if ( FileSystem::fileExtension( editor->getDocument().getFilename() ).empty() )
filename += editor->getSyntaxDefinition().getFileExtension();
std::string folderPath( FileSystem::fileRemoveFileName( editor->getDocument().getFilePath() ) );
std::string folderPath( !mLastFileFolder.empty() ? mLastFileFolder
: FileSystem::fileRemoveFileName(
editor->getDocument().getFilePath() ) );
if ( !FileSystem::isDirectory( folderPath ) )
folderPath = getLastUsedFolder();
UIFileDialog* dialog = UIFileDialog::New(
@@ -565,6 +567,7 @@ UIFileDialog* App::saveFileDialog( UICodeEditor* editor, bool focusOnClose ) {
if ( !path.empty() && !FileSystem::isDirectory( path ) &&
FileSystem::fileWrite( path, "" ) ) {
if ( editor->getDocument().save( path ) ) {
mLastFileFolder = FileSystem::fileRemoveFileName( path );
insertRecentFileAndUpdateUI( path );
updateEditorState();
} else {
@@ -1540,8 +1543,8 @@ void App::onTabCreated( UITab* tab, UIWidget* ) {
menuAdd( "split_top", "Split Top", "split-vertical", "split-top" );
menuAdd( "split_bottom", "Split Bottom", "split-vertical", "split-bottom" );
menuAdd( "open_containing_folder_ellipsis", "Open Containing Folder...", "folder-open",
"open-containing-folder" );
menuAdd( "open_containing_folder_in_fm", "Open Containing Folder in File Manager",
"folder-open", "open-containing-folder" );
menuAdd( "copy_containing_folder_path_ellipsis", "Copy Containing Folder Path...",
"copy", "copy-containing-folder-path" );
@@ -2483,8 +2486,8 @@ void App::fullscreenToggle() {
mSettings->updateViewMenu();
}
void App::showGlobalSearch( bool searchAndReplace ) {
mGlobalSearchController->showGlobalSearch( searchAndReplace );
void App::showGlobalSearch( bool searchAndReplace, std::optional<std::string> pathFilters ) {
mGlobalSearchController->showGlobalSearch( searchAndReplace, pathFilters );
}
void App::showFindView() {