Skip to content

Commit 7467a30

Browse files
Adapt to code review changes
Signed-off-by: Christian Parpart <christian@parpart.family>
1 parent b09a3d5 commit 7467a30

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/vtbackend/Screen.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1762,11 +1762,11 @@ void Screen<Cell>::requestAnsiMode(unsigned int mode)
17621762
template <CellConcept Cell>
17631763
void Screen<Cell>::requestDECMode(unsigned int mode)
17641764
{
1765-
auto const modeEnum = fromDECModeNum(mode);
1766-
1767-
auto const modeResponse = [&]() -> ModeResponse {
1765+
auto const modeResponse = [this, mode]() -> ModeResponse {
1766+
auto const modeEnum = fromDECModeNum(mode);
17681767
if (modeEnum.has_value())
17691768
{
1769+
auto const modeEnum = fromDECModeNum(mode);
17701770
if (_terminal->isModeEnabled(modeEnum.value()))
17711771
return ModeResponse::Set;
17721772
else

src/vtbackend/primitives.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -833,8 +833,8 @@ constexpr std::optional<DECMode> fromDECModeNum(unsigned int modeNum) noexcept
833833
case 2030: return DECMode::ReportGridCellSelection;
834834
case 2031: return DECMode::ReportColorPaletteUpdated;
835835
case 8452: return DECMode::SixelCursorNextToGraphic;
836+
default: return std::nullopt;
836837
}
837-
return std::nullopt;
838838
}
839839

840840
constexpr bool isValidDECMode(unsigned int mode) noexcept

0 commit comments

Comments
 (0)