When one clicks Shift+Enter on or evaluates a cell, it prevents you from typing/editing it, so it was thought
would stop this, but it did not. Then, a link in a comment below its answer was tested from
The referenced code evaluated was
With[
{ nb := EvaluationNotebook[]
, c := EvaluationCell[]
}
, With[
{ cv := CurrentValue[nb, {"TaggingRules", "LastCursorPosition"}]
, pos := FrontEndExecute@FrontEnd`UndocumentedGetSelectionPacket[nb]
}
, With[
{ savePosition := (
cv = If[MemberQ[pos, "CharacterRange" -> _], Last["CharacterRange" /. pos], False]
)
}
, SetOptions[nb
, CellEventActions :> {
{"MenuCommand", "HandleShiftReturn"} :> savePosition
, {"MenuCommand", "EvaluateCells"} :> savePosition
, PassEventsDown -> True
}
, CellEpilog :> If[
IntegerQ[cv]
, SelectionMove[c, Before, CellContents]
; SelectionMove[nb, Next, Character, cv]
; cv = False
]
]
]
]
]
However, it made it so that when clicking Shift+Enter to evaluate a cell, nothing happens. This issue only is on the notebook where this code was evaluated.
Unfortunately, refreshing the page, closing/reopening the tab, clicking “Reset to Default” in “Preferences” for “Evaluation”, and clicking “Evaluation” then “Restart Session” and “Quit Kernel” did not fix this issue. These steps usually reset presets for Wolfram Cloud, but not do so for this specific one.
The version is 14.0.0 for Linux x86 (64-bit) (December 13, 2023).
How does one make Wolfram Cloud be able to use Shift+Enter and fix this glitch?
FrontEnd`UndocumentedGetSelectionPacket
won't work there. And if you have problems with input cells in long notebooks without this code I suggest to contact Wolfram Support. $\endgroup$