Skip to content

Commit

Permalink
Change format of cursor pos in statusbar to match ODE (#706)
Browse files Browse the repository at this point in the history
* change format of cursor pos in statusbar

* hide CC GC in statusbar
  • Loading branch information
e9gille authored May 13, 2021
1 parent f0d1dc0 commit ba2b8f6
Show file tree
Hide file tree
Showing 8 changed files with 302 additions and 291 deletions.
4 changes: 2 additions & 2 deletions src/ed.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
const ed = this;
const { me } = ed;
const model = me.getModel();
ed.ide.setCursorPosition(e.position);
ed.ide.setCursorPosition(e.position, model.getLineCount());
if (ed.xline == null) return;
const n = model.getLineCount();
const l = e.position.lineNumber;
Expand Down Expand Up @@ -331,7 +331,7 @@
}
window.focused || window.focus();
ed.me.focus();
ed.ide.setCursorPosition(ed.me.getPosition());
ed.ide.setCursorPosition(ed.me.getPosition(), ed.me.getModel().getLineCount());
},
insert(ch) {
this.isReadOnly || this.me.trigger('editor', 'type', { text: ch });
Expand Down
16 changes: 10 additions & 6 deletions src/ide.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,12 @@ D.IDE = function IDE(opts = {}) {
I.sb_dq.hidden = !1;
I.sb_sis.hidden = !1;
I.sb_threads.hidden = !1;
I.sb_cc.hidden = !1;
I.sb_gc.hidden = !1;
ide.showCCGC = (x) => {
I.sb_cc.hidden = !x;
I.sb_gc.hidden = I.sb_cc.hidden;
};
D.prf.showCCGC(showCCGC);
ide.showCCGC(D.prf.showCCGC());
ide.wins[0] = new D.Se(ide);
D.wins = ide.wins;
D.send('GetSyntaxInformation', {});
Expand Down Expand Up @@ -773,8 +777,6 @@ D.IDE = function IDE(opts = {}) {
I.sb_trap.classList.toggle('active', x.TRAP !== 0);
I.sb_dq.classList.toggle('active', x.DQ !== 0);
I.sb_threads.classList.toggle('active', x.NumThreads > 1);
// I.sb_cc.classList.toggle('active', x.CompactCount !== 1);
// I.sb_gc.classList.toggle('active', x.GarbageCount !== 0);
},
ReplyFormatCode(x) {
const w = D.wins[x.win];
Expand Down Expand Up @@ -820,6 +822,8 @@ D.IDE = function IDE(opts = {}) {
I.sb_io.hidden = true;
I.sb_trap.hidden = true;
I.sb_dq.hidden = true;
I.sb_cc.hidden = true;
I.sb_gc.hidden = true;
toggleStats();
} else if (x.name === 'GetConfiguration') {
D.get_configuration_na = 1;
Expand All @@ -836,8 +840,8 @@ D.IDE.prototype = {
ide.profile = z;
ide.updTitle();
},
setCursorPosition(p) {
I.sb_cp.innerText = `Ln ${p.lineNumber - 1}, Col ${p.column - 1}`;
setCursorPosition(p, lc) {
I.sb_cp.innerText = `Pos: ${p.lineNumber - 1}/${lc},${p.column - 1}`;
},
die() { // don't really, just pretend
const ide = this;
Expand Down
1 change: 1 addition & 0 deletions src/prf.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ D.prf = {};
['sbar', 1], //show status bar
['selectedExe', ''],//which interpreter is selected in dropdown in the Connect page?
['selectionHighlight', 0],// hightlight matching words
['showCCGC', 0], // show CC and GC in statusbar
['showEditorToolbar', 1],// show toolbar in editor windows
['snippetSuggestions', 1],// show snippet suggestions
['title', '{WSID}'], //a.k.a. "caption"
Expand Down
4 changes: 2 additions & 2 deletions src/se.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
se.btm = se.me.getContentHeight() + e.scrollTop;
});
me.onDidFocusEditorText(() => { se.focusTS = +new Date(); se.ide.focusedWin = se; });
me.onDidChangeCursorPosition(e => ide.setCursorPosition(e.position));
me.onDidChangeCursorPosition(e => ide.setCursorPosition(e.position, se.me.getModel().getLineCount()));
se.promptType = 0; // see ../docs/protocol.md #SetPromptType
se.processAutocompleteReply = D.ac(me);
// me.viewModel.viewLayout.constructor.LINES_HORIZONTAL_EXTRA_PX = 14;
Expand Down Expand Up @@ -350,7 +350,7 @@
D.elw && D.elw.focus();
window.focused || window.focus();
this.me.focus();
this.ide.setCursorPosition(this.me.getPosition());
this.ide.setCursorPosition(this.me.getPosition(), this.me.getModel().getLineCount());
},
insert(ch) {
this.isReadOnly || this.me.trigger('editor', 'type', { text: ch });
Expand Down
156 changes: 78 additions & 78 deletions style/dark-theme.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
.ctl_listview {
background-color: #1c1e28;
color: white;
}
.ctl_listview tr {
background-color: rgba(118, 136, 217, 0.5);
border-bottom: 1px solid #1c1e28;
}
.ctl_listview tr:hover {
background-color: rgba(118, 136, 217, 0.25);
}
.ctl_listview tr.selected {
background-color: #1c1e28;
}
#debug {
background: #1c1e28;
}
#debug .ctl_listview_header {
background-color: #7688d9;
color: white;
}
#debug .ctl_listview_header h2 {
font-size: 16px;
}
#cn input:not([type=button]):not([type=file]):not([type=submit]):not([type=checkbox]),
#cn textarea {
border: 1px solid rgba(169, 169, 169, 0.3);
Expand Down Expand Up @@ -72,30 +96,6 @@
font-size: 16px;
font-family: monospace;
}
.ctl_listview {
background-color: #1c1e28;
color: white;
}
.ctl_listview tr {
background-color: rgba(118, 136, 217, 0.5);
border-bottom: 1px solid #1c1e28;
}
.ctl_listview tr:hover {
background-color: rgba(118, 136, 217, 0.25);
}
.ctl_listview tr.selected {
background-color: #1c1e28;
}
#debug {
background: #1c1e28;
}
#debug .ctl_listview_header {
background-color: #7688d9;
color: white;
}
#debug .ctl_listview_header h2 {
font-size: 16px;
}
/*various dialogs*/
#dlg_modal_overlay {
background-color: black;
Expand Down Expand Up @@ -142,60 +142,6 @@
text-align: left;
border: 1px solid transparent;
}
label {
color: #a9a9a9;
font-family: Roboto;
font-size: 14px;
font-weight: 600;
}
label.cb_label {
cursor: pointer;
}
button {
background: #7688d9;
color: white;
border-radius: 4px;
background-image: -moz-linear-gradient(90deg, #7688d9 0%, #9eabe4 100%);
background-image: -webkit-linear-gradient(90deg, #7688d9 0%, #9eabe4 100%);
background-image: -ms-linear-gradient(90deg, #7688d9 0%, #9eabe4 100%);
}
button:hover {
color: #4c4a4a;
}
[type=checkbox] {
background-color: #1c1e28;
border: 1px solid #7688d9;
}
[type=checkbox]:checked {
background-color: #7688d9;
}
[type=checkbox]:hover::before {
background: #323446;
}
[type=checkbox]:active::before {
background: #7688d9;
color: #323446;
}
[type=checkbox]:checked::before {
color: #7688d9;
}
[type=checkbox]:checked:after {
color: #1c1e28;
}
[type=checkbox]:disabled::before {
color: transparent;
box-shadow: 0 0 0 1px #7688d9 inset;
background: #323446;
}
[type=checkbox]:checked:disabled::before {
color: grayscale(#7688d9);
background: grayscale(#1c1e28);
}
select {
background-color: #272937;
border: 1px solid rgba(169, 169, 169, 0.3);
color: white;
}
/*Golden Layout*/
.lm_goldenlayout {
background: #272937 !important;
Expand Down Expand Up @@ -282,6 +228,60 @@ select {
background-color: white;
border: 1px dashed #7688d9;
}
label {
color: #a9a9a9;
font-family: Roboto;
font-size: 14px;
font-weight: 600;
}
label.cb_label {
cursor: pointer;
}
button {
background: #7688d9;
color: white;
border-radius: 4px;
background-image: -moz-linear-gradient(90deg, #7688d9 0%, #9eabe4 100%);
background-image: -webkit-linear-gradient(90deg, #7688d9 0%, #9eabe4 100%);
background-image: -ms-linear-gradient(90deg, #7688d9 0%, #9eabe4 100%);
}
button:hover {
color: #4c4a4a;
}
[type=checkbox] {
background-color: #1c1e28;
border: 1px solid #7688d9;
}
[type=checkbox]:checked {
background-color: #7688d9;
}
[type=checkbox]:hover::before {
background: #323446;
}
[type=checkbox]:active::before {
background: #7688d9;
color: #323446;
}
[type=checkbox]:checked::before {
color: #7688d9;
}
[type=checkbox]:checked:after {
color: #1c1e28;
}
[type=checkbox]:disabled::before {
color: transparent;
box-shadow: 0 0 0 1px #7688d9 inset;
background: #323446;
}
[type=checkbox]:checked:disabled::before {
color: grayscale(#7688d9);
background: grayscale(#1c1e28);
}
select {
background-color: #272937;
border: 1px solid rgba(169, 169, 169, 0.3);
color: white;
}
#lb {
background-color: #1c1e28;
border-bottom: 1px black solid;
Expand Down
5 changes: 4 additions & 1 deletion style/less/layout/status_bar.less
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
.tb_btn {
padding:0;
}
}
}
#sb_cp {
min-width: 15em;
}
#sb_prf {
padding: 2px 6px 3px;
}
Expand Down
Loading

0 comments on commit ba2b8f6

Please sign in to comment.