Respect cell.is_editable during find-and-replace

Find and replace (searchandreplace.js) will overwrite the contents of cells even if they are marked as non-editable. Add a check against the cell's is_editable() method to ensure this only happens for editable cells.
This commit is contained in:
Adam Blake 2020-06-20 13:05:57 -07:00 committed by GitHub
parent 9fa644bbe4
commit f2db0265d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -308,6 +308,10 @@ define([
var cells = get_cells(env);
for (var c = 0; c < cells.length; c++) {
var cell = cells[c];
if (!cell.is_editable()) {
continue;
}
var oldvalue = cell.code_mirror.getValue();
var newvalue = oldvalue.replace(reg , replaceValue);
cell.code_mirror.setValue(newvalue);