/
githubmirror
/
brackets
Обзор
Документация
Войти
/
githubmirror
/
brackets
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/extensions/default/CodeFolding/foldhelpers/foldSelected.js
30 строк
922 B
kimohyeong
Correct typo (#13861)
16 ноя 2017, 20:27
16 ноя 2017, 20:27
72244f8
Код
Авторство
О чём код?
/** * Selection range helper for code folding. * @author Patrick Oladimeji * @date 31/07/2015 00:11:53 */ define(function (require, exports, module) { "use strict"; /** * This helper returns the start and end range representing the current selection in the editor. * @param {Object} cm The Codemirror instance * @param {Object} start A Codemirror.Pos object {line, ch} representing the current line we are * checking for fold ranges * @returns {Object} The fold range, {from, to} representing the current selection. */ function SelectionFold(cm, start) { if (!cm.somethingSelected()) { return; } var from = cm.getCursor("from"), to = cm.getCursor("to"); if (from.line === start.line) { return {from: from, to: to}; } } module.exports = SelectionFold; });