mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-23 13:54:54 +02:00
Safely convert EOLs
Prevent eol conversion frrom readonly file. Closes #1702, Closes #1701, Closes #1581, Closes #1371
This commit is contained in:
parent
d9e62f1af6
commit
4c6e5af484
@ -1815,8 +1815,14 @@ void Notepad_plus::command(int id)
|
||||
: (id == IDM_FORMAT_TOUNIX) ? EolType::unix : EolType::macos;
|
||||
|
||||
Buffer* buf = _pEditView->getCurrentBuffer();
|
||||
|
||||
if (not buf->isReadOnly())
|
||||
{
|
||||
LongRunningOperation op;
|
||||
buf->setEolFormat(newFormat);
|
||||
_pEditView->execute(SCI_CONVERTEOLS, static_cast<int>(buf->getEolFormat()));
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user