rocketinventor / ace-minimap

A plugin to add a minimap to ace text editor
11 stars 3 forks source link

Position minimap relative to ace editor #3

Closed rocketinventor closed 9 years ago

rocketinventor commented 9 years ago

Right now, it is positioned based off of the entire page. That cannot work because the editor could be in different positions based on what elements are visible. For example there can be panels on the left and right of the text area. The minimap needs to be changed so that its position is relative to the ace editor.

nightwing commented 9 years ago

I'd suggest to start developing this using https://github.com/ajaxorg/ace/blob/master/kitchen-sink.html This will be simpler since minimap needs to deal only with one editor.

List of all tokens in the document can be obtained with editor.session.bgTokenizer.lines Minimap can modify https://github.com/ajaxorg/ace/blob/master/lib/ace/scrollbar.js to put canvas inside the scrollbar.

https://github.com/laughinghan/minimap/blob/master/public/minimap.js can't help much since ace doesn't create dom for whole document, but https://github.com/atom-minimap/minimap should be useable.