You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I started reading the "Scripting" chapter of your nice book, and arrived at the Macro section. I tried out the macro proposed there across all lines and found out that it doesn't work in one of them. In particular, it doesn't work on the abul fazl is the historian line, because in step 4 of the macro when moving by one word, in most other lines the cursor would now be on the word is, but on this line it is on fazl instead, which means the macro for this particular line results in something like Abul was a the historian in Akbar's court., not at all what should have happened. And because this section is meant to showcase the power of macros, having the macro fail like that could confuse newcomers to Vim, leading them to think they did something wrong.
The most obvious solution for this would probably be to remove the abul fazl line altogether, since the other 3 lines are proof enough that the macro works well on a predictable context.
Thanks in advance for understanding.
P.S. Another step you could add to ensure the reproduction of the macro doesn't fail under different circumstances could be to add 0 at the beginning of the macro to ensure that the cursor is at the beginning of the line, because moving downwards lines by j often puts the cursor elsewhere than on the first character of the line, and when the macro is triggered from anywhere but the beginning of the line it obviously doesn't result in the desired outcome.
The text was updated successfully, but these errors were encountered:
I started reading the "Scripting" chapter of your nice book, and arrived at the Macro section. I tried out the macro proposed there across all lines and found out that it doesn't work in one of them. In particular, it doesn't work on the
abul fazl is the historian
line, because in step 4 of the macro when moving by one word, in most other lines the cursor would now be on the wordis
, but on this line it is onfazl
instead, which means the macro for this particular line results in something likeAbul was a the historian in Akbar's court.
, not at all what should have happened. And because this section is meant to showcase the power of macros, having the macro fail like that could confuse newcomers to Vim, leading them to think they did something wrong.The most obvious solution for this would probably be to remove the
abul fazl
line altogether, since the other 3 lines are proof enough that the macro works well on a predictable context.Thanks in advance for understanding.
P.S. Another step you could add to ensure the reproduction of the macro doesn't fail under different circumstances could be to add
0
at the beginning of the macro to ensure that the cursor is at the beginning of the line, because moving downwards lines by j often puts the cursor elsewhere than on the first character of the line, and when the macro is triggered from anywhere but the beginning of the line it obviously doesn't result in the desired outcome.The text was updated successfully, but these errors were encountered: