问题
I have a problem that I am unable to use the "Stage line/selection" and "Discard line/selection" buttons that appear when selecting specific lines in the Rstudio git review changes. When pressed, the selection disappears and nothing happens.
To illustrate, say I have a file in which I have made some additions and deletions:
Note, the "Stage chunk" and "Discard chunk" buttons on the right works as expected.
Now, say I wish to stage and commit only the added lines (the code comment). I first select the lines:
However, selecting either of the buttons, the first line of the selection is kept and nothing is staged:
Again, nothing happens if "stage chunk" or "discard chunk" is pressed for the single line selection that remains.
The problem seems to be a bit intermittent. My experience is, that it often happens if I have made many and "complex" changes. Editing a few lines does not cause the problem. From searching, I've only found suggestions to avoid spaces in files (which I do not have).
Edit, May 2020 Now appears as an issue at GitHub:
https://github.com/rstudio/rstudio/issues/5476
来源:https://stackoverflow.com/questions/53196915/buttons-to-stage-and-discard-selections-in-rstudio-editor-not-working