Implement line command, misc style adjustments #21
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have implemented a "naïve first attempt" at the line command in response to #6, permitting dodo to jump to specific line numbers. Immediately, I can see two issues:
As you state in #6, we can put the responsibility for (1) onto the user, however I'm not sure if we can say the same about (2) or not. Some simple testing has been added for the line command but we are still lacking the ability to test failure conditions, which limits the amount of testing we can add.
This command makes me wonder if we should also extend the byte command to allow relative byte jumps. It's useful to jump to a certain line, but it is also then useful to jump to a certain section of that line, and currently the only way of doing this would be
e/foo/w/foo/
to jump overfoo
at the start of a line, which is far from ideal.I have also aligned some if blocks with the style used throughout the rest of the source and added a little extra something to the interactive prompt to show the current cursor position in bytes .