__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
import { runInOp } from "../display/operations.js"
import { ensureCursorVisible } from "../display/scrolling.js"
import { cmp } from "../line/pos.js"
import { replaceRange } from "../model/changes.js"
import { lst } from "../util/misc.js"
// Helper for deleting text near the selection(s), used to implement
// backspace, delete, and similar functionality.
export function deleteNearSelection(cm, compute) {
let ranges = cm.doc.sel.ranges, kill = []
// Build up a set of ranges to kill first, merging overlapping
// ranges.
for (let i = 0; i < ranges.length; i++) {
let toKill = compute(ranges[i])
while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) {
let replaced = kill.pop()
if (cmp(replaced.from, toKill.from) < 0) {
toKill.from = replaced.from
break
}
}
kill.push(toKill)
}
// Next, remove those actual ranges.
runInOp(cm, () => {
for (let i = kill.length - 1; i >= 0; i--)
replaceRange(cm.doc, "", kill[i].from, kill[i].to, "+delete")
ensureCursorVisible(cm)
})
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| CodeMirror.js | File | 8.42 KB | 0644 |
|
| commands.js | File | 7.33 KB | 0644 |
|
| deleteNearSelection.js | File | 1.03 KB | 0644 |
|
| drop_events.js | File | 5.01 KB | 0644 |
|
| fromTextArea.js | File | 1.94 KB | 0644 |
|
| global_events.js | File | 1.41 KB | 0644 |
|
| key_events.js | File | 5.38 KB | 0644 |
|
| legacy.js | File | 2.52 KB | 0644 |
|
| main.js | File | 2.02 KB | 0644 |
|
| methods.js | File | 21.72 KB | 0644 |
|
| mouse_events.js | File | 15.6 KB | 0644 |
|
| options.js | File | 7.06 KB | 0644 |
|
| utils.js | File | 270 B | 0644 |
|