I need to implement "old school" ruler for monaco editor, which will work similarly to ISPF cols
command:
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
000200 //IEFBR14 EXEC PGM=IEFBR14
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
000300 //IEFBR14 EXEC PGM=IEFBR14
000400 //IEFBR14 EXEC PGM=IEFBR14
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
000500 //IEFBR14 EXEC PGM=IEFBR14
The ISPF cols
command:
- The ruler is read-only
- The ruler is not saved
- You can place
cols
to any line(s)
I am aware of rulers: [ a, b, c, ... ]
setting which is not very helpful, there are (on mainframe) many specialized (=weird) languages/products, where preset ruler will not help.
I have also found and modified this, but the ruler is placed into the line 1 over the editor text:
var intervalId = setInterval(() => {
var viewRuler = document.querySelector(".view-ruler");
if (viewRuler?.style.left) {
viewRuler.textContent = '----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8';
viewRuler.style.width = viewRuler.style.left; // change width to the same as left
viewRuler.style.left = "0px"; // change left to 0
clearInterval(intervalId); // clear interval
console.dir(viewRuler);
}
}, 1000);