mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-09-28 15:13:21 +08:00
python、shell、cmd根据本机环境动态代码提示
This commit is contained in:
@@ -495,24 +495,33 @@ let hasCustomIcon = () => {
|
||||
|
||||
let programCheck = () => {
|
||||
let mode = $('#program').val();
|
||||
$('.customscript').hide();
|
||||
$('.simulation').hide();
|
||||
$('#showInTerm').prop("disabled", false);
|
||||
if (!hasCustomIcon()) $("#icon").attr('src', `logo/${mode}.png`);
|
||||
switch (mode) {
|
||||
case 'custom':
|
||||
$('.customscript').show();
|
||||
$('.simulation').hide();
|
||||
$('#showInTerm').prop("disabled", false);
|
||||
break;
|
||||
case 'simulation':
|
||||
$('.simulation').show();
|
||||
$('.customscript').hide();
|
||||
$('#showInTerm').prop("disabled", true);
|
||||
mode = 'javascript';
|
||||
break;
|
||||
case 'csharp':
|
||||
case 'c':
|
||||
mode = 'text/x-' + mode
|
||||
break;
|
||||
case 'python':
|
||||
getPythonMods()
|
||||
break;
|
||||
case 'cmd':
|
||||
getCmdCommand()
|
||||
break;
|
||||
case 'shell':
|
||||
getShellCommand()
|
||||
break;
|
||||
default:
|
||||
$('.customscript').hide();
|
||||
$('.simulation').hide();
|
||||
$('#showInTerm').prop("disabled", false);
|
||||
(mode == 'csharp' || mode == 'c') && (mode = 'text/x-' + mode)
|
||||
break;
|
||||
}
|
||||
window.editor.setOption("mode", mode);
|
||||
|
Reference in New Issue
Block a user