refactor: Update window creation and file dialog handling for improved consistency
- Replaced `SDL_Deleter` with `util::SDL_Deleter` in window creation for better utility usage. - Updated file dialog methods to consistently reference `core::FeatureFlags` for feature flag checks. - Refactored file extension retrieval in `EditorManager` to use `util::GetFileExtension` for consistency. - Adjusted `MusicEditor` constructor to accept a ROM pointer, enhancing initialization clarity. - Commented out unused code in `MusicEditor` to improve readability and maintainability. - Updated include paths in `overworld_editor.cc` for better organization. - Cleaned up commented-out code in `editor_selection_dialog.cc` and `welcome_screen.cc` for clarity.
This commit is contained in:
@@ -1967,7 +1967,7 @@ void AgentChatWidget::OpenFileInEditor(const std::string& filepath) {
|
||||
filepath.substr(last_slash + 1) : filepath;
|
||||
|
||||
// Set language based on extension
|
||||
std::string ext = core::GetFileExtension(filepath);
|
||||
std::string ext = util::GetFileExtension(filepath);
|
||||
if (ext == "cpp" || ext == "cc" || ext == "h" || ext == "hpp") {
|
||||
tab.editor.SetLanguageDefinition(TextEditor::LanguageDefinition::CPlusPlus());
|
||||
} else if (ext == "c") {
|
||||
@@ -1994,7 +1994,7 @@ void AgentChatWidget::CreateNewFileInEditor(const std::string& filename) {
|
||||
tab.modified = true;
|
||||
|
||||
// Set language based on extension
|
||||
std::string ext = core::GetFileExtension(filename);
|
||||
std::string ext = util::GetFileExtension(filename);
|
||||
if (ext == "cpp" || ext == "cc" || ext == "h" || ext == "hpp") {
|
||||
tab.editor.SetLanguageDefinition(TextEditor::LanguageDefinition::CPlusPlus());
|
||||
} else if (ext == "c") {
|
||||
|
||||
Reference in New Issue
Block a user