__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
import { lineNumberFor } from "../line/utils_line.js"
import { compensateForHScroll } from "../measurement/position_measurement.js"
import { elt } from "../util/dom.js"
import { updateGutterSpace } from "./update_display.js"
// Re-align line numbers and gutter marks to compensate for
// horizontal scrolling.
export function alignHorizontally(cm) {
let display = cm.display, view = display.view
if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return
let comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft
let gutterW = display.gutters.offsetWidth, left = comp + "px"
for (let i = 0; i < view.length; i++) if (!view[i].hidden) {
if (cm.options.fixedGutter) {
if (view[i].gutter)
view[i].gutter.style.left = left
if (view[i].gutterBackground)
view[i].gutterBackground.style.left = left
}
let align = view[i].alignable
if (align) for (let j = 0; j < align.length; j++)
align[j].style.left = left
}
if (cm.options.fixedGutter)
display.gutters.style.left = (comp + gutterW) + "px"
}
// Used to ensure that the line number gutter is still the right
// size for the current document size. Returns true when an update
// is needed.
export function maybeUpdateLineNumberWidth(cm) {
if (!cm.options.lineNumbers) return false
let doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display
if (last.length != display.lineNumChars) {
let test = display.measure.appendChild(elt("div", [elt("div", last)],
"CodeMirror-linenumber CodeMirror-gutter-elt"))
let innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW
display.lineGutter.style.width = ""
display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1
display.lineNumWidth = display.lineNumInnerWidth + padding
display.lineNumChars = display.lineNumInnerWidth ? last.length : -1
display.lineGutter.style.width = display.lineNumWidth + "px"
updateGutterSpace(cm.display)
return true
}
return false
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| Display.js | File | 4.75 KB | 0644 |
|
| focus.js | File | 1.55 KB | 0644 |
|
| gutters.js | File | 1.52 KB | 0644 |
|
| highlight_worker.js | File | 2.22 KB | 0644 |
|
| line_numbers.js | File | 2.12 KB | 0644 |
|
| mode_state.js | File | 621 B | 0644 |
|
| operations.js | File | 7.89 KB | 0644 |
|
| scroll_events.js | File | 4.85 KB | 0644 |
|
| scrollbars.js | File | 7.31 KB | 0644 |
|
| scrolling.js | File | 7.98 KB | 0644 |
|
| selection.js | File | 7.29 KB | 0644 |
|
| update_display.js | File | 10.26 KB | 0644 |
|
| update_line.js | File | 7.8 KB | 0644 |
|
| update_lines.js | File | 3.39 KB | 0644 |
|
| view_tracking.js | File | 5.26 KB | 0644 |
|