261 if not pattern: |
261 if not pattern: |
262 return |
262 return |
263 |
263 |
264 text = editor.text() |
264 text = editor.text() |
265 newText = "".join([ |
265 newText = "".join([ |
266 line for line in text.splitlines(keepends=True) |
266 line for line in text.splitlines(True) |
267 if not line.lstrip().startswith(pattern) or |
267 if not line.lstrip().startswith(pattern) or |
268 "__NO_REMOVE__" in line |
268 "__NO_REMOVE__" in line |
269 ]) |
269 ]) |
270 if newText != text: |
270 if newText != text: |
271 editor.beginUndoAction() |
271 editor.beginUndoAction() |