forked from qt-creator/qt-creator
Add option to configure file line ending for an open document
Add into the text editor toolbar a combo box which allows to change the line endings for an open document. The supported line endings are LF and CRLF. Change-Id: I029ba7867e0087b162edba7aba1bd1d1e966fd69 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -101,6 +101,11 @@ void BaseTextDocument::setSupportsUtf8Bom(bool value)
|
||||
d->m_supportsUtf8Bom = value;
|
||||
}
|
||||
|
||||
void BaseTextDocument::setLineTerminationMode(Utils::TextFileFormat::LineTerminationMode mode)
|
||||
{
|
||||
d->m_format.lineTerminationMode = mode;
|
||||
}
|
||||
|
||||
/*!
|
||||
Autodetects format and reads in the text file specified by \a fileName.
|
||||
*/
|
||||
@@ -149,6 +154,11 @@ bool BaseTextDocument::supportsUtf8Bom() const
|
||||
return d->m_supportsUtf8Bom;
|
||||
}
|
||||
|
||||
Utils::TextFileFormat::LineTerminationMode BaseTextDocument::lineTerminationMode() const
|
||||
{
|
||||
return d->m_format.lineTerminationMode;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the format obtained from the last call to \c read().
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user