title: Buttons to stage and discard selections in Rstudio editor not working
body: <p>I have a problem that I am unable to use the &quot;Stage line/selection&quot; and &quot;Discard line/selection&quot; buttons that appear when selecting specific lines in the Rstudio git review changes. When pressed, the selection disappears and nothing happens.</p>
  <p>To illustrate, say I have a file in which I have made some additions and deletions:</p>
  <hr />
  <p><a href="https://i.stack.imgur.com/rHQ4a.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rHQ4a.png" alt="Nothing selected" /></a></p>
  <hr />
  <p>Note, the &quot;Stage chunk&quot; and &quot;Discard chunk&quot; buttons on the right works as expected.</p>
  <p>Now, say I wish to stage and commit only the added lines (the code comment). I first select the lines:</p>
  <hr />
  <p><a href="https://i.stack.imgur.com/0Nm2G.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0Nm2G.png" alt="Addition selected" /></a></p>
  <hr />
  <p>However, selecting either of the buttons, the first line of the selection is kept and nothing is staged:</p>
  <hr />
  <p><a href="https://i.stack.imgur.com/GiiWh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GiiWh.png" alt="Result" /></a></p>
  <hr />
  <p>Again, nothing happens if &quot;stage chunk&quot; or &quot;discard chunk&quot; is pressed for the single line selection that remains.</p>
  <p>The problem seems to be a bit intermittent.  My experience is, that it often happens if I have made many and &quot;complex&quot; changes. Editing a few lines does not cause the problem. From searching, I've only found suggestions to avoid spaces in filenames (which I do not have).</p>
  <p><strong>Edit, May 2020</strong>
  Now appears as an issue at GitHub:</p>
  <p><a href="https://github.com/rstudio/rstudio/issues/5476" rel="nofollow noreferrer">https://github.com/rstudio/rstudio/issues/5476</a></p>