Skip to content

Commit

Permalink
do no change selections if the action is from toolbar.
Browse files Browse the repository at this point in the history
  • Loading branch information
rebornix committed Mar 24, 2021
1 parent 7d19db7 commit 51c4031
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ export async function copyCellRange(context: INotebookCellActionContext, directi
const selections = viewModel.getSelections();
const newCells = cellRangesToIndexes([range]).map(index => cloneNotebookCellTextModel(viewModel.viewCells[index].model));
const countDelta = newCells.length;
const newFocus = { start: focus.start + countDelta, end: focus.end + countDelta };
const newSelections = [{ start: range.start + countDelta, end: range.end + countDelta }];
const newFocus = context.ui ? focus : { start: focus.start + countDelta, end: focus.end + countDelta };
const newSelections = context.ui ? selections : [{ start: range.start + countDelta, end: range.end + countDelta }];
viewModel.notebookDocument.applyEdits([
{
editType: CellEditType.Replace,
Expand Down

0 comments on commit 51c4031

Please sign in to comment.