aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2024-01-27 20:08:50 +1100
committerNeil <nyamatongwe@gmail.com>2024-01-27 20:08:50 +1100
commit5f1a05f6570e56990092480d2ba0c99c0c48e0fa (patch)
treee72f22b087b485662e9d5c84cccc7520dd181e84 /src
parent7e32149ab735019ad029c0559b99998b2d525053 (diff)
downloadscintilla-mirror-5f1a05f6570e56990092480d2ba0c99c0c48e0fa.tar.gz
Use noexcept where reasonable.
Diffstat (limited to 'src')
-rw-r--r--src/CellBuffer.cxx32
-rw-r--r--src/CellBuffer.h32
2 files changed, 32 insertions, 32 deletions
diff --git a/src/CellBuffer.cxx b/src/CellBuffer.cxx
index 575aae584..28df64dc1 100644
--- a/src/CellBuffer.cxx
+++ b/src/CellBuffer.cxx
@@ -491,7 +491,7 @@ void UndoHistory::EndUndoAction() {
}
}
-void UndoHistory::DropUndoSequence() {
+void UndoHistory::DropUndoSequence() noexcept {
undoSequenceDepth = 0;
}
@@ -530,11 +530,11 @@ bool UndoHistory::AfterDetachPoint() const noexcept {
return detach && (*detach < currentAction);
}
-void UndoHistory::TentativeStart() {
+void UndoHistory::TentativeStart() noexcept {
tentativePoint = currentAction;
}
-void UndoHistory::TentativeCommit() {
+void UndoHistory::TentativeCommit() noexcept {
tentativePoint = -1;
// Truncate undo history
maxAction = currentAction;
@@ -558,7 +558,7 @@ bool UndoHistory::CanUndo() const noexcept {
return (currentAction > 0) && (maxAction > 0);
}
-int UndoHistory::StartUndo() {
+int UndoHistory::StartUndo() noexcept {
// Drop any trailing startAction
if (actions[currentAction].at == ActionType::start && currentAction > 0)
currentAction--;
@@ -571,11 +571,11 @@ int UndoHistory::StartUndo() {
return currentAction - act;
}
-const Action &UndoHistory::GetUndoStep() const {
+const Action &UndoHistory::GetUndoStep() const noexcept {
return actions[currentAction];
}
-void UndoHistory::CompletedUndoStep() {
+void UndoHistory::CompletedUndoStep() noexcept {
currentAction--;
}
@@ -583,7 +583,7 @@ bool UndoHistory::CanRedo() const noexcept {
return maxAction > currentAction;
}
-int UndoHistory::StartRedo() {
+int UndoHistory::StartRedo() noexcept {
// Drop any leading startAction
if (currentAction < maxAction && actions[currentAction].at == ActionType::start)
currentAction++;
@@ -596,11 +596,11 @@ int UndoHistory::StartRedo() {
return act - currentAction;
}
-const Action &UndoHistory::GetRedoStep() const {
+const Action &UndoHistory::GetRedoStep() const noexcept {
return actions[currentAction];
}
-void UndoHistory::CompletedRedoStep() {
+void UndoHistory::CompletedRedoStep() noexcept {
currentAction++;
}
@@ -913,11 +913,11 @@ bool CellBuffer::IsSavePoint() const noexcept {
return uh.IsSavePoint();
}
-void CellBuffer::TentativeStart() {
+void CellBuffer::TentativeStart() noexcept {
uh.TentativeStart();
}
-void CellBuffer::TentativeCommit() {
+void CellBuffer::TentativeCommit() noexcept {
uh.TentativeCommit();
}
@@ -1325,7 +1325,7 @@ void CellBuffer::BasicDeleteChars(Sci::Position position, Sci::Position deleteLe
}
}
-bool CellBuffer::SetUndoCollection(bool collectUndo) {
+bool CellBuffer::SetUndoCollection(bool collectUndo) noexcept {
collectingUndo = collectUndo;
uh.DropUndoSequence();
return collectingUndo;
@@ -1356,11 +1356,11 @@ bool CellBuffer::CanUndo() const noexcept {
return uh.CanUndo();
}
-int CellBuffer::StartUndo() {
+int CellBuffer::StartUndo() noexcept {
return uh.StartUndo();
}
-const Action &CellBuffer::GetUndoStep() const {
+const Action &CellBuffer::GetUndoStep() const noexcept {
return uh.GetUndoStep();
}
@@ -1392,11 +1392,11 @@ bool CellBuffer::CanRedo() const noexcept {
return uh.CanRedo();
}
-int CellBuffer::StartRedo() {
+int CellBuffer::StartRedo() noexcept {
return uh.StartRedo();
}
-const Action &CellBuffer::GetRedoStep() const {
+const Action &CellBuffer::GetRedoStep() const noexcept {
return uh.GetRedoStep();
}
diff --git a/src/CellBuffer.h b/src/CellBuffer.h
index b46b582c1..701472f4f 100644
--- a/src/CellBuffer.h
+++ b/src/CellBuffer.h
@@ -65,7 +65,7 @@ public:
void BeginUndoAction();
void EndUndoAction();
- void DropUndoSequence();
+ void DropUndoSequence() noexcept;
void DeleteUndoHistory();
/// The save point is a marker in the undo stack where the container has stated that
@@ -78,21 +78,21 @@ public:
bool AfterDetachPoint() const noexcept;
// Tentative actions are used for input composition so that it can be undone cleanly
- void TentativeStart();
- void TentativeCommit();
+ void TentativeStart() noexcept;
+ void TentativeCommit() noexcept;
bool TentativeActive() const noexcept;
int TentativeSteps() noexcept;
/// To perform an undo, StartUndo is called to retrieve the number of steps, then UndoStep is
/// called that many times. Similarly for redo.
bool CanUndo() const noexcept;
- int StartUndo();
- const Action &GetUndoStep() const;
- void CompletedUndoStep();
+ int StartUndo() noexcept;
+ const Action &GetUndoStep() const noexcept;
+ void CompletedUndoStep() noexcept;
bool CanRedo() const noexcept;
- int StartRedo();
- const Action &GetRedoStep() const;
- void CompletedRedoStep();
+ int StartRedo() noexcept;
+ const Action &GetRedoStep() const noexcept;
+ void CompletedRedoStep() noexcept;
};
struct SplitView {
@@ -211,12 +211,12 @@ public:
void SetSavePoint();
bool IsSavePoint() const noexcept;
- void TentativeStart();
- void TentativeCommit();
+ void TentativeStart() noexcept;
+ void TentativeCommit() noexcept;
bool TentativeActive() const noexcept;
int TentativeSteps() noexcept;
- bool SetUndoCollection(bool collectUndo);
+ bool SetUndoCollection(bool collectUndo) noexcept;
bool IsCollectingUndo() const noexcept;
void BeginUndoAction();
void EndUndoAction();
@@ -226,12 +226,12 @@ public:
/// To perform an undo, StartUndo is called to retrieve the number of steps, then UndoStep is
/// called that many times. Similarly for redo.
bool CanUndo() const noexcept;
- int StartUndo();
- const Action &GetUndoStep() const;
+ int StartUndo() noexcept;
+ const Action &GetUndoStep() const noexcept;
void PerformUndoStep();
bool CanRedo() const noexcept;
- int StartRedo();
- const Action &GetRedoStep() const;
+ int StartRedo() noexcept;
+ const Action &GetRedoStep() const noexcept;
void PerformRedoStep();
void ChangeHistorySet(bool set);