Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Take A QuizChallenge yourself and boost your learning! Start the quiz now to earn credits.
Take A QuizUnlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
Take A QuizGeneral Tech Learning Aids/Tools 2 years ago
Posted on 16 Aug 2022, this text provides information on Learning Aids/Tools related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.
No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
General Tech 10 Answers
General Tech 7 Answers
General Tech 3 Answers
General Tech 9 Answers
Is Foldable Smartphone Technology the Future or Just a Trend?
Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.
manpreet
Best Answer
2 years ago
I'm trying to understand how to move in the undo tree with the following default mappings:
u
,
,g-
andg+
Here's my understanding of things, which is probably wrong or incomplete. Each time we make a new edit, a new leaf is created in the undo tree. The more we make edits, the more leafs are added along a branch.
To move along the branch, we can use
u
to go back to the original version of the buffer, and
to go forward to the newest version.This can be confirmed with the simple following test:
1
,
to increment it to2
, again to3
and again to4
Using
u
and
, we can go back to each state of the buffer: empty,1
,2
,3
and4
.If at one point, we go backward and make a new edit from a past leaf, we create a new branch. The leafs which are not between the root of the tree (the original buffer) and the beginning of the new branch (the last edit we just made) can't be accessed with
u
and
.Going back to the example, this can be confirmed:
4
, hitu
to go back to3
r5
to replace3
with5
u
to undo the last editThe last
u
doesn't bring us back to4
but to3
.We can't go back anymore to
4
withu
and
because they only move along the shortest path between the root of the tree and the most recent version of the buffer which we've visited.4
is not on the shortest path between the original empty buffer and5
, because5
was created from3
.To go back to any leaf of the undo tree, we can use
g-
andg+
. Contrary tou
and
, they move along a time axis on which every leaf is placed in the order it was created.To confirm this:
u
up to the original empty bufferg+
5 times to reach1
,2
,3
,4
and5
g-
5 times to get back to4
,3
,2
,1
and the empty bufferHowever, there's one case I don't understand. If from
5
, we hitu
to get back to3
, theng+
, we get5
. But on the time axis, the nearest leaf from3
is not5
, it's4
.So why does Vim bring us to
5
instead of4
?