markText and splitting over lines does not allow for CSS adapted to the end #819

joscha opened this Issue Sep 11, 2012 · 1 comment


None yet

2 participants

joscha commented Sep 11, 2012

When marking text using the CodeMirror.markText method that splits over a line (e.g. {from: {line:0, ch:0}, to: {line:1, ch: 10}}) CodeMirror automatically detects this and creates multiple s which is perfect.
However in some cases (e.g. display a visual marker at the end of the marking via CSS) it would be needed to actually know where the marking ends exactly in CSS.
As a workaround one can use onChange together with fetching all nodes regarding the highlight class and adding an additional class on the last element, however that is slow and error-prone.
It would be very handy if CodeMirror would add a special class to the last chunk of a marking (e.g. the last element).

<div style="">
  <pre><span class="highlight">bla</span></pre>
  <pre><span class="highlight cm-marking-chunked-last">foo</span></pre>
joscha commented Sep 11, 2012

using CodeMirror 2.33

@marijnh marijnh closed this in acb6aa6 Sep 11, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment