mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-09-01 22:12:46 +00:00
24 lines
593 B
JavaScript
24 lines
593 B
JavaScript
/*\
|
|
title: $:/core/modules/editor/operations/text/replace-selection.js
|
|
type: application/javascript
|
|
module-type: texteditoroperation
|
|
|
|
Text editor operation to replace the selection
|
|
|
|
\*/
|
|
(function(){
|
|
|
|
/*jslint node: true, browser: true */
|
|
/*global $tw: false */
|
|
"use strict";
|
|
|
|
exports["replace-selection"] = function(event,operation) {
|
|
operation.replacement = event.paramObject.text;
|
|
operation.cutStart = operation.selStart;
|
|
operation.cutEnd = operation.selEnd;
|
|
operation.newSelStart = operation.selStart;
|
|
operation.newSelEnd = operation.selStart + operation.replacement.length;
|
|
};
|
|
|
|
})();
|