summaryrefslogtreecommitdiff
path: root/src/client.cc
diff options
context:
space:
mode:
authorJohannes Altmanninger <aclopte@gmail.com>2022-08-06 21:55:39 +0200
committerJohannes Altmanninger <aclopte@gmail.com>2022-09-02 02:56:41 +0200
commitdd4ba2ee88747616f7125024b192cec75cd7e58c (patch)
tree1164260f6bee949b70b1bf1446b236a43ce32161 /src/client.cc
parent611bdebf3cd43c05bdf7573adf4f4a0a2fbc2efe (diff)
Prepare to record selection changes as perceived by the user
To be able to undo selection changes, we want to record selections from all commands that modify selections. Each such command will get its own private copy of the selections object. This copy will live until the command is finished executing. All child commands that are run while the command is executing, will also use the same copy, because to the user it's all just one selection change anyway. Add an RAII object in all places where we might modify selections. The next commit will use this to create the private selections copy in the constructor (if there is none) and remove redundant history items in the destructor. We could avoid the RAII object in some places but that seems worse. For lifetimes that don't correspond to a lexical scope, we use a std::unique_ptr. For lambdas that require conversion to std::function, we use std::shared_ptr because we need something that's copyable.
Diffstat (limited to 'src/client.cc')
0 files changed, 0 insertions, 0 deletions