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
4d5159fe
Unverified
Commit
4d5159fe
authored
Apr 23, 2020
by
yann300
Committed by
GitHub
Apr 23, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2763 from ethereum/fixSolMode
Better file type extraction
parents
958ecca3
a293d5c4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
editor.js
src/app/editor/editor.js
+5
-7
No files found.
src/app/editor/editor.js
View file @
4d5159fe
...
...
@@ -243,13 +243,11 @@ class Editor extends Plugin {
* @param {string} path Path of the file
*/
_getMode
(
path
)
{
let
ext
=
path
.
indexOf
(
'.'
)
!==
-
1
?
/
[^
.
]
+/
.
exec
(
path
)
:
null
if
(
ext
)
{
ext
=
path
.
replace
(
ext
[
0
]
+
'.'
,
''
)
// we get <ext>
}
else
ext
=
'txt'
ext
=
ext
.
split
(
'#'
)
if
(
!
ext
.
length
)
return
this
.
modes
[
'txt'
]
ext
=
ext
[
0
]
if
(
!
path
)
return
this
.
modes
[
'txt'
]
const
root
=
path
.
split
(
'#'
)[
0
].
split
(
'?'
)[
0
]
let
ext
=
root
.
indexOf
(
'.'
)
!==
-
1
?
/
[^
.
]
+$/
.
exec
(
root
)
:
null
if
(
ext
)
ext
=
ext
[
0
]
else
ext
=
'txt'
return
ext
&&
this
.
modes
[
ext
]
?
this
.
modes
[
ext
]
:
this
.
modes
[
'txt'
]
}
...
...
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