src/search/ScrollTrackMarkers.js
function setVisible(curEditor, visible) {
        // short-circuit no-ops
        if ((visible && curEditor === editor) || (!visible && !editor)) {
            return;
        }

        if (visible) {
            console.assert(!editor);
            editor = curEditor;

            // Don't support inline editors yet - search inside them is pretty screwy anyway (#2110)
            if (editor.isTextSubset()) {
                return;
            }

            var $sb = _getScrollbar(editor),
                $overlay = $("<div class='tickmark-track'></div>");
            $sb.parent().append($overlay);

            _calcScaling();

            // Update tickmarks during editor resize (whenever resizing has paused/stopped for > 1/3 sec)
            WorkspaceManager.on("workspaceUpdateLayout.ScrollTrackMarkers", _.debounce(function () {
                if (marks.length) {
                    _calcScaling();
                    $(".tickmark-track", editor.getRootElement()).empty();
                    _renderMarks(marks);
                }
            }, 300));

        } else {
            console.assert(editor === curEditor);
            $(".tickmark-track", curEditor.getRootElement()).remove();
            editor = null;
            marks = [];
            WorkspaceManager.off("workspaceUpdateLayout.ScrollTrackMarkers");
        }
    }
function setVisible(curEditor, visible) {
        // short-circuit no-ops
        if ((visible && curEditor === editor) || (!visible && !editor)) {
            return;
        }

        if (visible) {
            console.assert(!editor);
            editor = curEditor;

            // Don't support inline editors yet - search inside them is pretty screwy anyway (#2110)
            if (editor.isTextSubset()) {
                return;
            }

            var $sb = _getScrollbar(editor),
                $overlay = $("<div class='tickmark-track'></div>");
            $sb.parent().append($overlay);

            _calcScaling();

            // Update tickmarks during editor resize (whenever resizing has paused/stopped for > 1/3 sec)
            WorkspaceManager.on("workspaceUpdateLayout.ScrollTrackMarkers", _.debounce(function () {
                if (marks.length) {
                    _calcScaling();
                    $(".tickmark-track", editor.getRootElement()).empty();
                    _renderMarks(marks);
                }
            }, 300));

        } else {
            console.assert(editor === curEditor);
            $(".tickmark-track", curEditor.getRootElement()).remove();
            editor = null;
            marks = [];
            WorkspaceManager.off("workspaceUpdateLayout.ScrollTrackMarkers");
        }
    }
function setVisible ( curEditor , visible ) { // short-circuit no-ops if ( ( visible && curEditor === editor ) || ( ! visible && ! editor ) ) { return ; } if ( visible ) { console . assert ( ! editor ) ; editor = curEditor ; // Don't support inline editors yet - search inside them is pretty screwy anyway (#2110) if ( editor . isTextSubset ( ) ) { return ; } var $sb = _getScrollbar ( editor ) , $overlay = $ ( "<div class='tickmark-track'></div>" ) ; $sb . parent ( ) . append ( $overlay ) ; _calcScaling ( ) ; // Update tickmarks during editor resize (whenever resizing has paused/stopped for > 1/3 sec) WorkspaceManager . on ( "workspaceUpdateLayout.ScrollTrackMarkers" , _ . debounce ( function ( ) { if ( marks . length ) { _calcScaling ( ) ; $ ( ".tickmark-track" , editor . getRootElement ( ) ) . empty ( ) ; _renderMarks ( marks ) ; } } , 300 ) ) ; } else { console . assert ( editor === curEditor ) ; $ ( ".tickmark-track" , curEditor . getRootElement ( ) ) . remove ( ) ; editor = null ; marks = [ ] ; WorkspaceManager . off ( "workspaceUpdateLayout.ScrollTrackMarkers" ) ; } }
Add or remove the tickmark track from the editor's UI
Add or remove the tickmark track from the editor s UI