diff --git a/projects/linux/ecode/AppRun b/projects/linux/ecode/AppRun index 5a31ee753..cd4be8e9e 100755 --- a/projects/linux/ecode/AppRun +++ b/projects/linux/ecode/AppRun @@ -1,7 +1,6 @@ #!/bin/sh -CANONPATH=`readlink -f "$0"` -DIRPATH="`dirname "$CANONPATH"`" -cd $DIRPATH - -LD_LIBRARY_PATH=./libs ./ecode +CANONPATH=$(readlink -f "$0") +DIRPATH="$(dirname "$CANONPATH")" +cd "$DIRPATH" || exit +LD_LIBRARY_PATH=./libs ./ecode.bin "$@" diff --git a/projects/linux/ecode/build.app.sh b/projects/linux/ecode/build.app.sh index f19369513..00aa13301 100755 --- a/projects/linux/ecode/build.app.sh +++ b/projects/linux/ecode/build.app.sh @@ -3,7 +3,22 @@ CANONPATH=$(readlink -f "$0") DIRPATH="$(dirname "$CANONPATH")" cd "$DIRPATH" || exit cd ../../../ || exit -premake4 --with-mojoal gmake +DEBUG_SYMBOLS="" +for i in "$@"; do + case $i in + --with-debug-symbols) + DEBUG_SYMBOLS="--with-debug-symbols" + shift + ;; + -*|--*) + echo "Unknown option $i" + exit 1 + ;; + *) + ;; + esac +done +premake4 "$DEBUG_SYMBOLS" --with-mojoal gmake cd make/linux || exit make -j"$(nproc)" config=release ecode cd "$DIRPATH" || exit @@ -15,8 +30,8 @@ cp AppRun ecode.app/ cp ecode.desktop ecode.app/ cp ../../../bin/assets/icon/ee.png ecode.app/ecode.png cp ../../../libs/linux/libeepp.so ecode.app/libs/ -cp ../../../bin/ecode ecode.app/ -cp -L $(whereis libSDL2-2.0.so.0 | awk '{print $NF}') ecode.app/libs/ +cp ../../../bin/ecode ecode.app/ecode.bin +cp -L "$(whereis libSDL2-2.0.so.0 | awk '{print $NF}')" ecode.app/libs/ strip ecode.app/libs/libSDL2-2.0.so.0 mkdir -p ecode.app/assets/colorschemes mkdir -p ecode.app/assets/fonts @@ -50,4 +65,26 @@ then chmod +x "$APPIMAGETOOL" fi -$APPIMAGETOOL ecode.app ecode-linux-"$ECODE_MAJOR_VERSION"."$ECODE_MINOR_VERSION"."$ECODE_PATCH_LEVEL"-"$(arch)".AppImage +ECODE_NAME=ecode-linux-"$ECODE_MAJOR_VERSION"."$ECODE_MINOR_VERSION"."$ECODE_PATCH_LEVEL"-"$(arch)" + +if [ -n "$DEBUG_SYMBOLS" ]; +then + cp -r ecode.app ecode + rm ecode/.DirIcon + mv ecode/AppRun ecode/ecode + 7za a -t7z "$ECODE_NAME"-with-debug-symbols.7z ecode -mx9 -mmt"$(nproc)" + rm -rf ecode + objcopy -S ecode.app/ecode.bin ecode.app/ecode.bin + objcopy -S ecode.app/libs/libeepp.so ecode.app/libs/libeepp.so +fi + +$APPIMAGETOOL ecode.app "$ECODE_NAME".AppImage + +rm ecode.app/.DirIcon +mv ecode.app/AppRun ecode.app/ecode +mv ecode.app ecode + +tar -czf "$ECODE_NAME".tar.gz ecode + +mv ecode ecode.app + diff --git a/src/modules/eterm/src/eterm/ui/uiterminal.cpp b/src/modules/eterm/src/eterm/ui/uiterminal.cpp index 4d8ef7bb4..fb15c72e9 100644 --- a/src/modules/eterm/src/eterm/ui/uiterminal.cpp +++ b/src/modules/eterm/src/eterm/ui/uiterminal.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include using namespace EE::Scene; @@ -406,6 +407,12 @@ bool UITerminal::isUsingCustomTitle() const { } Uint32 UITerminal::onTextInput( const TextInputEvent& event ) { + Input* input = getUISceneNode()->getWindow()->getInput(); + + if ( ( input->isLeftAltPressed() && !event.getText().empty() && event.getText()[0] == '\t' ) || + input->isLeftControlPressed() || input->isMetaPressed() || input->isLeftAltPressed() ) + return 0; + mTerm->onTextInput( event.getChar() ); return 1; } diff --git a/src/tools/ecode/ecode.cpp b/src/tools/ecode/ecode.cpp index f1c930d0e..4622315b2 100644 --- a/src/tools/ecode/ecode.cpp +++ b/src/tools/ecode/ecode.cpp @@ -1132,7 +1132,9 @@ UIMenu* App::createViewMenu() { mSplitter->setHideTabBarOnSingleTab( mConfig.editor.hideTabBarOnSingleTab ); } else if ( item->getId() == "treeview-single-click-nav" ) { mConfig.editor.singleClickTreeNavigation = item->asType()->isActive(); - mProjectTreeView->setSingleClickNavigation( mConfig.editor.singleClickTreeNavigation ); + if ( mProjectTreeView ) + mProjectTreeView->setSingleClickNavigation( + mConfig.editor.singleClickTreeNavigation ); } else if ( item->getId() == "sync-project-tree" ) { mConfig.editor.syncProjectTreeWithEditor = item->asType()->isActive(); } else { @@ -1257,10 +1259,10 @@ UIMenu* App::createTerminalMenu() { mTerminalMenu->addCheckBox( i18n( "exclusive_mode", "Exclusive Mode" ), false, getKeybind( UITerminal::getExclusiveModeToggleCommandName() ) ); exclusiveChk - ->setTooltipText( - i18n( "exclusive_mode_tooltip", - "Global Keybindings are disabled when exclusive mode is enabled.\nThis is to " - "avoid keyboard shortcut overlapping between the terminal an the application." ) ) + ->setTooltipText( i18n( + "exclusive_mode_tooltip", + "Global Keybindings are disabled when exclusive mode is enabled.\nThis is to " + "avoid keyboard shortcut overlapping between the terminal and the application." ) ) ->setId( "exclusive-mode" ); mTerminalMenu @@ -2128,7 +2130,7 @@ void App::updateDocInfo( TextDocument& doc ) { } void App::syncProjectTreeWithEditor( UICodeEditor* editor ) { - if ( mConfig.editor.syncProjectTreeWithEditor && editor != nullptr && + if ( mProjectTreeView && mConfig.editor.syncProjectTreeWithEditor && editor != nullptr && ( editor->getDocument().hasFilepath() || !editor->getDocument().getLoadingFilePath().empty() ) ) { std::string loadingPath( editor->getDocument().getLoadingFilePath() ); @@ -3114,7 +3116,8 @@ void App::toggleHiddenFiles() { mFileSystemModel = FileSystemModel::New( mFileSystemModel->getRootPath(), FileSystemModel::Mode::FilesAndDirectories, { true, true, !mFileSystemModel->getDisplayConfig().ignoreHidden } ); - mProjectTreeView->setModel( mFileSystemModel ); + if ( mProjectTreeView ) + mProjectTreeView->setModel( mFileSystemModel ); } void App::newFile( const FileInfo& file ) { @@ -3419,7 +3422,8 @@ void App::loadFolder( const std::string& path ) { mFileSystemModel = FileSystemModel::New( rpath, FileSystemModel::Mode::FilesAndDirectories, { true, true, true } ); - mProjectTreeView->setModel( mFileSystemModel ); + if ( mProjectTreeView ) + mProjectTreeView->setModel( mFileSystemModel ); if ( mFileSystemListener ) mFileSystemListener->setFileSystemModel( mFileSystemModel );