From a10559634f30d070d53b6c99db66f2b87d581c9c Mon Sep 17 00:00:00 2001 From: Steven Hugg Date: Sat, 24 Nov 2018 16:08:33 -0500 Subject: [PATCH] can't create a blank file; fixed .h gutter format; right align info links --- css/ui.css | 3 +++ src/baseplatform.ts | 2 ++ src/ui.ts | 15 ++++++++------- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/css/ui.css b/css/ui.css index 06e02fbc..48df267c 100644 --- a/css/ui.css +++ b/css/ui.css @@ -109,6 +109,9 @@ div.mem_info a:hover { div.mem_info a.selected { color: #ffffff; } +.mem_info_links { + text-align:right; +} .btn_group { border-radius:6px; padding:8px; diff --git a/src/baseplatform.ts b/src/baseplatform.ts index a191f2d2..70dc9840 100644 --- a/src/baseplatform.ts +++ b/src/baseplatform.ts @@ -286,6 +286,7 @@ export abstract class BaseFrameBasedPlatform extends BaseDebugPlatform { export function getToolForFilename_6502(fn:string) : string { if (fn.endsWith(".pla")) return "plasm"; if (fn.endsWith(".c")) return "cc65"; + if (fn.endsWith(".h")) return "cc65"; if (fn.endsWith(".s")) return "ca65"; if (fn.endsWith(".ca65")) return "ca65"; if (fn.endsWith(".dasm")) return "dasm"; @@ -572,6 +573,7 @@ export abstract class BaseZ80Platform extends BaseDebugPlatform { export function getToolForFilename_z80(fn) { if (fn.endsWith(".c")) return "sdcc"; + if (fn.endsWith(".h")) return "sdcc"; if (fn.endsWith(".s")) return "sdasz80"; if (fn.endsWith(".ns")) return "naken"; if (fn.endsWith(".scc")) return "sccz80"; diff --git a/src/ui.ts b/src/ui.ts index 11d59826..a01e7d1e 100644 --- a/src/ui.ts +++ b/src/ui.ts @@ -229,7 +229,7 @@ function getSkeletonFile(fileid:string, callback) { function _createNewFile(e) { // TODO: support spaces var filename = prompt("Create New File", "newfile" + platform.getDefaultExtension()); - if (filename && filename.length) { + if (filename && filename.trim().length > 0) { if (filename.indexOf(" ") >= 0) { alert("No spaces, please."); return; @@ -409,6 +409,7 @@ function _revertFile(e) { } }, 'text') .fail(function() { + // TODO: delete file alert("Can only revert built-in files."); }); return true; @@ -572,7 +573,7 @@ function showDebugInfo(state?) { if (s) { var hs = lastDebugInfo ? highlightDifferences(lastDebugInfo, s) : s; meminfo.show().html(hs); - var catspan = $(''); + var catspan = $('