aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Barnett <noreply@jamesbarnett.xyz>2018-02-16 19:23:58 +0000
committerJames Barnett <noreply@jamesbarnett.xyz>2018-02-16 19:23:58 +0000
commit9a730bfce2e0062f09201d0debe9b08a2ecb4d99 (patch)
tree079ee8c9c61dcf01f76ec8eef842df3a947f5983
parent7761eafe0d32042ccb04440c3761c42ed02237d0 (diff)
downloadsql-plus-plus-9a730bfce2e0062f09201d0debe9b08a2ecb4d99.tar.xz
sql-plus-plus-9a730bfce2e0062f09201d0debe9b08a2ecb4d99.zip
Display current cursor row/col
-rw-r--r--index.html2
-rw-r--r--renderer.js7
-rw-r--r--styles/style.css6
3 files changed, 10 insertions, 5 deletions
diff --git a/index.html b/index.html
index 2b6547c..7f51820 100644
--- a/index.html
+++ b/index.html
@@ -29,7 +29,7 @@
<div class="row footer">
<div id="execution-status" class="exec-idle">Idle</div>
<div id="execution-time"></div>
- <div id="row-count"></div>
+ <div id="cursor-coords"></div>
</div>
</div>
<script>
diff --git a/renderer.js b/renderer.js
index 946d6bb..750447f 100644
--- a/renderer.js
+++ b/renderer.js
@@ -15,7 +15,12 @@ const editorContext = cm(document.getElementById("editor"), {
gutters: ["CodeMirror-linenumbers", "statement-pointer"]
});
-const statementDelimiter = "/"
+editorContext.on("cursorActivity", (instance) => {
+ let coords = instance.getCursor();
+ $("#cursor-coords").text("Ln " + (parseInt(coords.line)+1) + ", Col " + (parseInt(coords.ch)+1));
+});
+
+const statementDelimiter = "/";
let dataTable;
let execStartTime;
diff --git a/styles/style.css b/styles/style.css
index db55827..b24351a 100644
--- a/styles/style.css
+++ b/styles/style.css
@@ -100,9 +100,9 @@ body {
padding: 2px 10px;
}
-#row-count {
- background-color: blue;
- flex-basis: auto;
+#cursor-coords {
+ margin-left: auto;
+ padding-right: 10px;
}
.exec-idle {