Skip to content

Commit f2db026

Browse files
authored
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.
1 parent 9fa644b commit f2db026

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

notebook/static/notebook/js/searchandreplace.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,10 @@ define([
308308
var cells = get_cells(env);
309309
for (var c = 0; c < cells.length; c++) {
310310
var cell = cells[c];
311+
if (!cell.is_editable()) {
312+
continue;
313+
}
314+
311315
var oldvalue = cell.code_mirror.getValue();
312316
var newvalue = oldvalue.replace(reg , replaceValue);
313317
cell.code_mirror.setValue(newvalue);

0 commit comments

Comments
 (0)