mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-12 11:45:38 +08:00
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:
parent
9fa644bbe4
commit
f2db0265d4
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user