Changeset View
Changeset View
Standalone View
Standalone View
src/render/katerenderer.cpp
Show First 20 Lines • Show All 1012 Lines • ▼ Show 20 Line(s) | 999 | { | |||
---|---|---|---|---|---|
1013 | l->setCacheEnabled(cacheLayout); | 1013 | l->setCacheEnabled(cacheLayout); | ||
1014 | 1014 | | |||
1015 | // Initial setup of the QTextLayout. | 1015 | // Initial setup of the QTextLayout. | ||
1016 | 1016 | | |||
1017 | // Tab width | 1017 | // Tab width | ||
1018 | QTextOption opt; | 1018 | QTextOption opt; | ||
1019 | opt.setFlags(QTextOption::IncludeTrailingSpaces); | 1019 | opt.setFlags(QTextOption::IncludeTrailingSpaces); | ||
1020 | opt.setTabStopDistance(m_tabWidth * m_fontMetrics.horizontalAdvance(spaceChar)); | 1020 | opt.setTabStopDistance(m_tabWidth * m_fontMetrics.horizontalAdvance(spaceChar)); | ||
1021 | if (m_view->config()->dynWrapAnywhere()) { | ||||
1022 | opt.setWrapMode(QTextOption::WrapAnywhere); | ||||
1023 | } else { | ||||
1021 | opt.setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere); | 1024 | opt.setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere); | ||
1025 | } | ||||
1022 | 1026 | | |||
1023 | // Find the first strong character in the string. | 1027 | // Find the first strong character in the string. | ||
1024 | // If it is an RTL character, set the base layout direction of the string to RTL. | 1028 | // If it is an RTL character, set the base layout direction of the string to RTL. | ||
1025 | // | 1029 | // | ||
1026 | // See http://www.unicode.org/reports/tr9/#The_Paragraph_Level (Sections P2 & P3). | 1030 | // See http://www.unicode.org/reports/tr9/#The_Paragraph_Level (Sections P2 & P3). | ||
1027 | // Qt's text renderer ("scribe") version 4.2 assumes a "higher-level protocol" | 1031 | // Qt's text renderer ("scribe") version 4.2 assumes a "higher-level protocol" | ||
1028 | // (such as KatePart) will specify the paragraph level, so it does not apply P2 & P3 | 1032 | // (such as KatePart) will specify the paragraph level, so it does not apply P2 & P3 | ||
1029 | // by itself. If this ever change in Qt, the next code block could be removed. | 1033 | // by itself. If this ever change in Qt, the next code block could be removed. | ||
▲ Show 20 Lines • Show All 172 Lines • Show Last 20 Lines |