mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-08-18 06:55:48 +03:00
Closes SpartanJ/ecode#33.
This commit is contained in:
@@ -145,11 +145,12 @@
|
||||
|
||||
#ifndef EE_ENDIAN
|
||||
|
||||
#if defined( __386__ ) || defined( i386 ) || defined( __i386__ ) || defined( __X86 ) || \
|
||||
defined( _M_IX86 ) || defined( _M_X64 ) || defined( __x86_64__ ) || defined( alpha ) || \
|
||||
defined( __alpha ) || defined( __alpha__ ) || defined( _M_ALPHA ) || defined( ARM ) || \
|
||||
defined( _ARM ) || defined( __arm__ ) || defined( WIN32 ) || defined( _WIN32 ) || \
|
||||
defined( __WIN32__ ) || defined( _WIN32_WCE ) || defined( __NT__ ) || defined( __MIPSEL__ )
|
||||
#if defined( __386__ ) || defined( i386 ) || defined( __i386__ ) || defined( __X86 ) || \
|
||||
defined( _M_IX86 ) || defined( _M_X64 ) || defined( __x86_64__ ) || defined( alpha ) || \
|
||||
defined( __alpha ) || defined( __alpha__ ) || defined( _M_ALPHA ) || defined( ARM ) || \
|
||||
defined( _ARM ) || defined( __arm__ ) || defined( WIN32 ) || defined( _WIN32 ) || \
|
||||
defined( __WIN32__ ) || defined( _WIN32_WCE ) || defined( __NT__ ) || defined( __MIPSEL__ ) || \
|
||||
defined( EE_ARM )
|
||||
#define EE_ENDIAN EE_LITTLE_ENDIAN
|
||||
#else
|
||||
#define EE_ENDIAN EE_BIG_ENDIAN
|
||||
|
||||
@@ -92,9 +92,11 @@ class EE_API TextDocument {
|
||||
|
||||
bool isNonWord( String::StringBaseType ch ) const;
|
||||
|
||||
bool hasFilepath();
|
||||
bool hasFilepath() const;
|
||||
|
||||
bool isEmpty();
|
||||
bool isEmpty() const;
|
||||
|
||||
bool isUntitledEmpty() const;
|
||||
|
||||
void reset();
|
||||
|
||||
|
||||
@@ -200,7 +200,13 @@ class EE_API UICodeEditorSplitter {
|
||||
t.setCommand( "close-tab", [&] { tryTabClose( mCurWidget ); } );
|
||||
t.setCommand( "create-new", [&] {
|
||||
auto d = createCodeEditorInTabWidget( tabWidgetFromWidget( mCurWidget ) );
|
||||
d.first->getTabWidget()->setTabSelected( d.first );
|
||||
if ( d.first != nullptr && d.second != nullptr ) {
|
||||
d.first->getTabWidget()->setTabSelected( d.first );
|
||||
} else if ( !mTabWidgets.empty() ) {
|
||||
d = createCodeEditorInTabWidget( mTabWidgets[0] );
|
||||
}
|
||||
if ( d.first == nullptr || d.second == nullptr )
|
||||
Log::error( "Couldn't createCodeEditorInTabWidget in create-new command" );
|
||||
} );
|
||||
t.setCommand( "next-tab", [&] {
|
||||
UITabWidget* tabWidget = tabWidgetFromWidget( mCurWidget );
|
||||
|
||||
@@ -366,7 +366,7 @@ end
|
||||
|
||||
function generate_os_links()
|
||||
if os.istarget("linux") then
|
||||
multiple_insert( os_links, { "rt", "pthread", "GL", "Xcursor" } )
|
||||
multiple_insert( os_links, { "rt", "pthread", "GL" } )
|
||||
|
||||
if _OPTIONS["with-static-eepp"] then
|
||||
table.insert( os_links, "dl" )
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 8.0.2, 2023-01-21T03:27:59. -->
|
||||
<!-- Written by QtCreator 8.0.2, 2023-02-08T16:38:47. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
|
||||
@@ -48,14 +48,18 @@ TextDocument::~TextDocument() {
|
||||
FileSystem::fileRemove( mFilePath );
|
||||
}
|
||||
|
||||
bool TextDocument::hasFilepath() {
|
||||
bool TextDocument::hasFilepath() const {
|
||||
return mDefaultFileName != mFilePath;
|
||||
}
|
||||
|
||||
bool TextDocument::isEmpty() {
|
||||
bool TextDocument::isEmpty() const {
|
||||
return linesCount() == 1 && line( 0 ).size() == 1;
|
||||
}
|
||||
|
||||
bool TextDocument::isUntitledEmpty() const {
|
||||
return isEmpty() && !hasFilepath();
|
||||
}
|
||||
|
||||
void TextDocument::reset() {
|
||||
mFilePath = mDefaultFileName;
|
||||
mFileRealPath = FileInfo();
|
||||
|
||||
@@ -835,8 +835,11 @@ void UICodeEditorSplitter::closeTab( UIWidget* widget ) {
|
||||
if ( tabWidget ) {
|
||||
if ( !( editor->getDocument().isEmpty() &&
|
||||
!tabWidget->getParent()->isType( UI_TYPE_SPLITTER ) &&
|
||||
tabWidget->getTabCount() == 1 ) ) {
|
||||
tabWidget->getTabCount() == 1 ) ||
|
||||
!editor->getDocument().isUntitledEmpty() ) {
|
||||
tabWidget->removeTab( (UITab*)editor->getData() );
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user