Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
d7cdc694
Commit
d7cdc694
authored
Mar 15, 2021
by
ioedeveloper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add workspace name to tabs
parent
d1e7c4ee
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
8 deletions
+56
-8
fileManager.js
apps/remix-ide/src/app/files/fileManager.js
+7
-0
tab-proxy.js
apps/remix-ide/src/app/panels/tab-proxy.js
+49
-8
No files found.
apps/remix-ide/src/app/files/fileManager.js
View file @
d7cdc694
...
...
@@ -610,6 +610,13 @@ class FileManager extends Plugin {
if
(
callback
)
callback
(
error
)
})
}
getCurrentWorkspace
()
{
const
file
=
this
.
currentFile
()
||
''
const
provider
=
this
.
fileProviderOf
(
file
)
return
provider
.
workspace
}
}
module
.
exports
=
FileManager
apps/remix-ide/src/app/panels/tab-proxy.js
View file @
d7cdc694
...
...
@@ -38,19 +38,43 @@ export class TabProxy extends Plugin {
})
fileManager
.
events
.
on
(
'fileRemoved'
,
(
name
)
=>
{
this
.
removeTab
(
name
)
const
workspace
=
this
.
fileManager
.
getCurrentWorkspace
()
workspace
?
this
.
removeTab
(
workspace
+
'/'
+
name
)
:
this
.
removeTab
(
this
.
fileManager
.
mode
+
'/'
+
name
)
})
fileManager
.
events
.
on
(
'fileClosed'
,
(
name
)
=>
{
this
.
removeTab
(
name
)
const
workspace
=
this
.
fileManager
.
getCurrentWorkspace
()
workspace
?
this
.
removeTab
(
workspace
+
'/'
+
name
)
:
this
.
removeTab
(
this
.
fileManager
.
mode
+
'/'
+
name
)
})
fileManager
.
events
.
on
(
'currentFileChanged'
,
(
file
)
=>
{
if
(
this
.
_handlers
[
file
])
{
this
.
_view
.
filetabs
.
activateTab
(
file
)
const
workspace
=
this
.
fileManager
.
getCurrentWorkspace
()
if
(
workspace
)
{
const
workspacePath
=
workspace
+
'/'
+
file
if
(
this
.
_handlers
[
workspacePath
])
{
this
.
_view
.
filetabs
.
activateTab
(
workspacePath
)
return
}
this
.
addTab
(
workspacePath
,
''
,
()
=>
{
this
.
fileManager
.
open
(
file
)
this
.
event
.
emit
(
'openFile'
,
file
)
},
()
=>
{
this
.
fileManager
.
closeFile
(
file
)
this
.
event
.
emit
(
'closeFile'
,
file
)
})
}
else
{
const
path
=
this
.
fileManager
.
mode
+
'/'
+
file
if
(
this
.
_handlers
[
path
])
{
this
.
_view
.
filetabs
.
activateTab
(
path
)
return
}
this
.
addTab
(
file
,
''
,
()
=>
{
this
.
addTab
(
path
,
''
,
()
=>
{
this
.
fileManager
.
open
(
file
)
this
.
event
.
emit
(
'openFile'
,
file
)
},
...
...
@@ -58,20 +82,37 @@ export class TabProxy extends Plugin {
this
.
fileManager
.
closeFile
(
file
)
this
.
event
.
emit
(
'closeFile'
,
file
)
})
}
})
fileManager
.
events
.
on
(
'fileRenamed'
,
(
oldName
,
newName
,
isFolder
)
=>
{
const
workspace
=
this
.
fileManager
.
getCurrentWorkspace
()
if
(
workspace
)
{
if
(
isFolder
)
{
for
(
const
tab
of
this
.
loadedTabs
)
{
if
(
tab
.
name
.
indexOf
(
oldName
+
'/'
)
===
0
)
{
const
newTabName
=
newName
+
tab
.
name
.
slice
(
oldName
.
length
,
tab
.
name
.
length
)
if
(
tab
.
name
.
indexOf
(
workspace
+
'/'
+
oldName
+
'/'
)
===
0
)
{
const
newTabName
=
workspace
+
'/'
+
newName
+
tab
.
name
.
slice
(
workspace
+
'/'
+
oldName
.
length
,
tab
.
name
.
length
)
this
.
renameTab
(
tab
.
name
,
newTabName
)
}
}
return
}
// should change the tab title too
this
.
renameTab
(
workspace
+
'/'
+
oldName
,
workspace
+
'/'
+
newName
)
}
else
{
if
(
isFolder
)
{
for
(
const
tab
of
this
.
loadedTabs
)
{
if
(
tab
.
name
.
indexOf
(
this
.
fileManager
.
mode
+
'/'
+
oldName
+
'/'
)
===
0
)
{
const
newTabName
=
this
.
fileManager
.
mode
+
'/'
+
newName
+
tab
.
name
.
slice
(
this
.
fileManager
.
mode
+
'/'
+
oldName
.
length
,
tab
.
name
.
length
)
this
.
renameTab
(
tab
.
name
,
newTabName
)
}
}
return
}
// should change the tab title too
this
.
renameTab
(
oldName
,
newName
)
this
.
renameTab
(
this
.
fileManager
.
mode
+
'/'
+
oldName
,
workspace
+
'/'
+
newName
)
}
})
appManager
.
event
.
on
(
'activate'
,
({
name
,
location
,
displayName
,
icon
})
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment