Wednesday 15 September 2010

javascript - Insert line widget at the end of line -



javascript - Insert line widget at the end of line -

i writing tool validates predicate logic proofs entered codemirror editor instance in realtime. purpose, want display dynamically generated info right next line info associated to. additionally, these hints should aligned within block should not cover code. sadly, have no clue how hack codemirror work.

my current approach display hint below line using "linewidgets":

but looks quite confusing. aim achive (of course of study without blank lines):

both linewidgets , widgets not come question, because linewidgets take whole line , widgets deed character can removed user. also, widgets cannot aligned vertically.

does have thought or suggestions how these hints displayed?

i think promising approach create own absolutely positions dom nodes, outside of editor, , position them using charcoords , similar methods. of course, you'll have hear "change" events , reposition widgets when necessary, unless dealing big documents thousands of widgets, should fast. (and if are, write repositioning logic in such way knows current viewport, , positions visible widgets.)

javascript layout codemirror

No comments:

Post a Comment