sourcegraph/sourcegraph-public-snapshot

Fix selection after running a settings quick action

開放

#2,756 建立於 2019年3月15日

 (8 則留言) (0 個反應) (2 位負責人)Go (1,374 個分叉)auto 404
bugfrontend-platformgood first issuewebapp

倉庫指標

星標
 (10,290 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

The settings quick actions (the buttons on the global/org/user settings JSON editor pages) yield the wrong selection after clicking them in some cases. The selection should be the newly added line, but it instead is the line above.

This only occurs for actions (such as setSearchContextLines) that DO NOT specify a selection text.

This is because the selection is computed as:

                    selection = monaco.Selection.fromPositions(
                        monacoEdits[0].range.getStartPosition(),
                        monacoEdits[monacoEdits.length - 1].range.getEndPosition()
                    )

and this breaks when the edit needs to add a trailing comma to the preceding line.

貢獻者指南