If I understand well your question, you can first select the last part of the text you are currently writing, and when activating the search option in Rstudio, you will need to tick search from selection. In that case if you write your search text it will stay in your selection area. kindly refer to the below screenshot of my Rstudioenter image description here
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…