Reputation: 1844
I first encountered on GitHub the "suggestion" code block, identified by
```suggestion
change
```
This offers to replace the line immediately before with what is inside the fence. But what about if I want to replace multiple lines?
I'd like to think this is possible, but I cannot find documentation of this feature anywhere. I have at least learned that the key terms to use are fenced code block and info string but the best I can come up with is that the info string (other than the first token) is unspecified.
Is this capability documented anywhere? It is emminently useful in code reviews.
Edit: This is a markdown question not a GitHub question
So far, it appears to be a GitHub-unique feature. That may be the answer, but telling me how to use the GitHub GUI is not addressing the question.
Upvotes: 77
Views: 37412
Reputation: 1910
To add a comment on multiple lines, click and drag to select the range of lines, then click the blue comment icon.
Upvotes: 146
Reputation: 220
Multi-line Github change request can be achieved by combining multi-line commenting and change request feature.
Step 1. Select multi-line commenting feature for lines that needs to be changed- How to do it
Step 2. then press <cmd+g>
Tada!!! Add your change request.
Upvotes: 3
Reputation: 4628
Github released multi-line code suggestions on February 26, 2020:
https://github.blog/changelog/2020-02-26-multi-line-code-suggestions-beta/
To select a multi-line code block, you can either:
- click and hold to the right of a line number, drag and then release the mouse when you’ve reached the last line of the desired selection; or
- click on a line number, hold Shift, click on a second line number and click the "+" button to the right of the second line number.
Once you've selected the code block, click the diff icon and edit the text within the suggestion block.
Upvotes: 2