aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Editor.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r--src/Editor.cxx48
1 files changed, 24 insertions, 24 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 90520856f..a89b83489 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -62,7 +62,7 @@ using namespace Scintilla;
return whether this modification represents an operation that
may reasonably be deferred (not done now OR [possibly] at all)
*/
-static bool CanDeferToLastStep(const DocModification &mh) {
+static bool CanDeferToLastStep(const DocModification &mh) noexcept {
if (mh.modificationType & (SC_MOD_BEFOREINSERT | SC_MOD_BEFOREDELETE))
return true; // CAN skip
if (!(mh.modificationType & (SC_PERFORMED_UNDO | SC_PERFORMED_REDO)))
@@ -72,7 +72,7 @@ static bool CanDeferToLastStep(const DocModification &mh) {
return false; // PRESUMABLY must do
}
-static bool CanEliminate(const DocModification &mh) {
+static bool CanEliminate(const DocModification &mh) noexcept {
return
(mh.modificationType & (SC_MOD_BEFOREINSERT | SC_MOD_BEFOREDELETE)) != 0;
}
@@ -81,7 +81,7 @@ static bool CanEliminate(const DocModification &mh) {
return whether this modification represents the FINAL step
in a [possibly lengthy] multi-step Undo/Redo sequence
*/
-static bool IsLastStep(const DocModification &mh) {
+static bool IsLastStep(const DocModification &mh) noexcept {
return
(mh.modificationType & (SC_PERFORMED_UNDO | SC_PERFORMED_REDO)) != 0
&& (mh.modificationType & SC_MULTISTEPUNDOREDO) != 0
@@ -89,13 +89,13 @@ static bool IsLastStep(const DocModification &mh) {
&& (mh.modificationType & SC_MULTILINEUNDOREDO) != 0;
}
-Timer::Timer() :
+Timer::Timer() noexcept :
ticking(false), ticksToWait(0), tickerID{} {}
-Idler::Idler() :
+Idler::Idler() noexcept :
state(false), idlerID(0) {}
-static inline bool IsAllSpacesOrTabs(const char *s, unsigned int len) {
+static inline bool IsAllSpacesOrTabs(const char *s, unsigned int len) noexcept {
for (unsigned int i = 0; i < len; i++) {
// This is safe because IsSpaceOrTab() will return false for null terminators
if (!IsSpaceOrTab(s[i]))
@@ -1464,7 +1464,7 @@ void Editor::NotifyCaretMove() {
void Editor::UpdateSystemCaret() {
}
-bool Editor::Wrapping() const {
+bool Editor::Wrapping() const noexcept {
return vs.wrapState != eWrapNone;
}
@@ -1613,7 +1613,7 @@ void Editor::LinesJoin() {
}
}
-const char *Editor::StringFromEOLMode(int eolMode) {
+const char *Editor::StringFromEOLMode(int eolMode) noexcept {
if (eolMode == SC_EOL_CRLF) {
return "\r\n";
} else if (eolMode == SC_EOL_CR) {
@@ -2521,7 +2521,7 @@ void Editor::CheckModificationForWrap(DocModification mh) {
}
// Move a position so it is still after the same character as before the insertion.
-static inline Sci::Position MovePositionForInsertion(Sci::Position position, Sci::Position startInsertion, Sci::Position length) {
+static inline Sci::Position MovePositionForInsertion(Sci::Position position, Sci::Position startInsertion, Sci::Position length) noexcept {
if (position > startInsertion) {
return position + length;
}
@@ -2530,7 +2530,7 @@ static inline Sci::Position MovePositionForInsertion(Sci::Position position, Sci
// Move a position so it is still after the same character as before the deletion if that
// character is still present else after the previous surviving character.
-static inline Sci::Position MovePositionForDeletion(Sci::Position position, Sci::Position startDeletion, Sci::Position length) {
+static inline Sci::Position MovePositionForDeletion(Sci::Position position, Sci::Position startDeletion, Sci::Position length) noexcept {
if (position > startDeletion) {
const Sci::Position endDeletion = startDeletion + length;
if (position > endDeletion) {
@@ -2711,7 +2711,7 @@ void Editor::NotifyModified(Document *, DocModification mh, void *) {
}
}
-void Editor::NotifyDeleted(Document *, void *) {
+void Editor::NotifyDeleted(Document *, void *) noexcept {
/* Do nothing */
}
@@ -2847,7 +2847,7 @@ void Editor::NotifyMacroRecord(unsigned int iMessage, uptr_t wParam, sptr_t lPar
}
// Something has changed that the container should know about
-void Editor::ContainerNeedsUpdate(int flags) {
+void Editor::ContainerNeedsUpdate(int flags) noexcept {
needUpdateUI |= flags;
}
@@ -3231,7 +3231,7 @@ constexpr short LowShortFromWParam(uptr_t x) {
return static_cast<short>(x & 0xffff);
}
-unsigned int WithExtends(unsigned int iMessage) {
+unsigned int WithExtends(unsigned int iMessage) noexcept {
switch (iMessage) {
case SCI_CHARLEFT: return SCI_CHARLEFTEXTEND;
case SCI_CHARRIGHT: return SCI_CHARRIGHTEXTEND;
@@ -3258,7 +3258,7 @@ unsigned int WithExtends(unsigned int iMessage) {
}
}
-int NaturalDirection(unsigned int iMessage) {
+int NaturalDirection(unsigned int iMessage) noexcept {
switch (iMessage) {
case SCI_CHARLEFT:
case SCI_CHARLEFTEXTEND:
@@ -3289,7 +3289,7 @@ int NaturalDirection(unsigned int iMessage) {
}
}
-bool IsRectExtend(unsigned int iMessage, bool isRectMoveExtends) {
+bool IsRectExtend(unsigned int iMessage, bool isRectMoveExtends) noexcept {
switch (iMessage) {
case SCI_CHARLEFTRECTEXTEND:
case SCI_CHARRIGHTRECTEXTEND:
@@ -4015,7 +4015,7 @@ void Editor::Indent(bool forwards) {
class CaseFolderASCII : public CaseFolderTable {
public:
- CaseFolderASCII() {
+ CaseFolderASCII() noexcept {
StandardASCII();
}
~CaseFolderASCII() override {
@@ -4160,7 +4160,7 @@ void Editor::GoToLine(Sci::Line lineNo) {
EnsureCaretVisible();
}
-static bool Close(Point pt1, Point pt2, Point threshold) {
+static bool Close(Point pt1, Point pt2, Point threshold) noexcept {
if (std::abs(pt1.x - pt2.x) > threshold.x)
return false;
if (std::abs(pt1.y - pt2.y) > threshold.y)
@@ -4383,7 +4383,7 @@ bool Editor::PointInSelMargin(Point pt) const {
}
}
-Window::Cursor Editor::GetMarginCursor(Point pt) const {
+Window::Cursor Editor::GetMarginCursor(Point pt) const noexcept {
int x = 0;
for (const MarginStyle &m : vs.ms) {
if ((pt.x >= x) && (pt.x < x + m.width))
@@ -4730,7 +4730,7 @@ void Editor::SetHotSpotRange(const Point *pt) {
}
}
-Range Editor::GetHotSpotRange() const {
+Range Editor::GetHotSpotRange() const noexcept {
return hotspot;
}
@@ -5572,11 +5572,11 @@ Sci::Position Editor::ReplaceTarget(bool replacePatterns, const char *text, Sci:
return length;
}
-bool Editor::IsUnicodeMode() const {
+bool Editor::IsUnicodeMode() const noexcept {
return pdoc && (SC_CP_UTF8 == pdoc->dbcsCodePage);
}
-int Editor::CodePage() const {
+int Editor::CodePage() const noexcept {
if (pdoc)
return pdoc->dbcsCodePage;
else
@@ -5612,7 +5612,7 @@ void Editor::AddStyledText(const char *buffer, Sci::Position appendLength) {
SetEmptySelection(sel.MainCaret() + lengthInserted);
}
-bool Editor::ValidMargin(uptr_t wParam) const {
+bool Editor::ValidMargin(uptr_t wParam) const noexcept {
return wParam < vs.ms.size();
}
@@ -5741,7 +5741,7 @@ void Editor::SetSelectionNMessage(unsigned int iMessage, uptr_t wParam, sptr_t l
ContainerNeedsUpdate(SC_UPDATE_SELECTION);
}
-sptr_t Editor::StringResult(sptr_t lParam, const char *val) {
+sptr_t Editor::StringResult(sptr_t lParam, const char *val) noexcept {
const size_t len = val ? strlen(val) : 0;
if (lParam) {
char *ptr = CharPtrFromSPtr(lParam);
@@ -5753,7 +5753,7 @@ sptr_t Editor::StringResult(sptr_t lParam, const char *val) {
return len; // Not including NUL
}
-sptr_t Editor::BytesResult(sptr_t lParam, const unsigned char *val, size_t len) {
+sptr_t Editor::BytesResult(sptr_t lParam, const unsigned char *val, size_t len) noexcept {
// No NUL termination: len is number of valid/displayed bytes
if ((lParam) && (len > 0)) {
char *ptr = CharPtrFromSPtr(lParam);