diff options
author | Zufu Liu <unknown> | 2023-01-12 22:02:24 +1100 |
---|---|---|
committer | Zufu Liu <unknown> | 2023-01-12 22:02:24 +1100 |
commit | 7ac090022ebef882b2b403174b06a3edf391e705 (patch) | |
tree | ef5e64fb038313bc7f5594b725f4869d74ccb1f3 /src/Document.cxx | |
parent | d57b40b5d815504ccd726ed5f2457df097141fd3 (diff) | |
download | scintilla-mirror-7ac090022ebef882b2b403174b06a3edf391e705.tar.gz |
Feature [feature-requests:#1474] Move EOL string function to Document and return
string_view.
Diffstat (limited to 'src/Document.cxx')
-rw-r--r-- | src/Document.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Document.cxx b/src/Document.cxx index 4f086af4b..9d25f0b08 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -1747,6 +1747,16 @@ void Document::ConvertLineEnds(EndOfLine eolModeSet) { } +std::string_view Document::EOLString() const noexcept { + if (eolMode == EndOfLine::CrLf) { + return "\r\n"; + } else if (eolMode == EndOfLine::Cr) { + return "\r"; + } else { + return "\n"; + } +} + DocumentOption Document::Options() const noexcept { return (IsLarge() ? DocumentOption::TextLarge : DocumentOption::Default) | (cb.HasStyles() ? DocumentOption::Default : DocumentOption::StylesNone); |