I am using the ACE editor for my site. I need to select / highlight a specific line in the editor. But when it’s big code, the ACE editor shows some errors, for example, when it scrolls line numbers and the highlight line number is different from the one I want to highlight. I searched and found this problem . But in fact, I can’t understand this. Can someone give an example for highlighting a line in the ACE editor? Here is my current code:
var aceLines = document.getElementsByClassName("ace_line"); var gutters = document.getElementsByClassName("ace_gutter-cell"); var gutLineNo = parseInt(gutters[0].innerHTML)-1; if(count1 != 0){ aceLines[arNum[count]-gutLineNo].style.backgroundColor = "green"; aceLines[arNum[count1]-gutLineNo].style.backgroundColor = "black"; }else{ aceLines[arNum[count]-gutLineNo].style.backgroundColor = "green"; }
dom. Ace dom- setMarker, Ace?
css,
.myMarker { position:absolute; background:rgba(100,200,100,0.5); z-index:20 }
var Range = ace.require('ace/range').Range; editor.session.addMarker(new Range(from, 0, to, 1), "myMarker", "fullLine");
from to - , .
from
to
Source: https://habr.com/ru/post/1568030/More articles:Finding data using Linq for a dataset - c #Where does it come from? - stringLoopback, как настроить вложенные отношения - javascriptDouble click to enlarge image in WP8? - c #https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1568029/spring-data-repository-detached-entity-passed-to-persist&usg=ALkJrhg6F-80io3JHH3lswc5ViutAVn39gКак присоединиться к модели в solr с рельсами sunspot - ruby-on-railsHow to create a typically limited property on an interface? - genericsRequest repo using string - elixirChange function definition without assignment - pythonlast part of resource identifier in var - javascriptAll Articles