返回介绍

Multi-Caret Editing

发布于 2020-09-10 13:29:47 字数 5193 浏览 896 评论 0 收藏 0

Multi-caret editing allows the user to activate two or more non-contiguous insertion points (identified by the blinking caret) within the active file.  Each caret acts and operates independently of any other caret, and any edit operations the user executes are performed in all caret locations simultaneously.  This is an optional feature and may be disabled completely in configuration under Advanced - Configuration - Editor Display - CursorCaret.html.

Multi-caret via mouse

Creating multiple carets via mouse

Regardless of how many carets are active, the user may add a new caret by holding the Ctrl key and left-mouse-button clicking at any location within the file where he can normally click to reposition the caret, including beyond a line end if the editor is configured for it.

Adding a new caret to an existing set via mouse

If the user has created a caret set and released Ctrl and wishes to add a new caret to the active set, then, prior to clicking anywhere else in the file, he may press Ctrl again and click in a new position to add a new caret to the existing set.

Removing a caret via mouse

The user may remove a caret from the active set by holding Ctrl and clicking on the caret he wishes to remove.  No other carets are affected.  The user may UNDO the last-created caret by pressing Ctrl + Alt + Z.

Clearing all multiple carets via mouse

To remove multiple carets, the user can release Ctrl and then click elsewhere in the file (not on an active selection). All carets will be removed and the clicked position will become the only active caret.

Multi-select

Multi-select is a component of multi-caret in that it allows the user to select multiple non-contiguous sections of data.

Multi-select via mouse

Creating multiple selections via mouse

Regardless of how many selections are active, the user may add a new selection by holding the Ctrl key and selecting any text within the file where he can normally do so.

The selection can be created via:

• Click-and-drag (standard selection)

• Double-/triple-click

• Click on line number

Adding a new selection to an existing set via mouse

If the user has created a selection set and released Ctrl and wishes to add a new caret to the active set, then, prior to clicking anywhere else in the file, he may press Ctrl again and select new text to add to the existing set.

Removing a selection via mouse

The user may remove a selection from the active set by holding Ctrl and clicking anywhere on the selection he wishes to remove.  No other selections are affected.  No caret is left where the user clicked.

Clearing all multiple selections via mouse

To remove multiple selections, the user must release Ctrl and then click elsewhere in the file (not on an active caret/selection). All carets will be removed and the clicked position will become the only active caret.

Movement of multi-carets

With a caret/selection set active, the user can reposition them as he normally would by using basic movement keys on the keyboard.  For example, pressing Left Arrow will move all carets to the left 1 position.  Pressing Down Arrow will move all carets down 1 line. Pressing HOME will move all carets to the beginning of each line. Page Up will move all carets up 1 page.  Any movement which would cause the carets to converge into a unified location will result in a single caret.  Examples include Ctrl + Home, Ctrl + End, Ctrl + Shift + Home, Ctrl + Shift + End, etc.

General editing with multi-caret

Once a user has a set of multi-carets and/or selections, he may do any number of general editing operations.

Copy/Cut

All selections are copied or cut into the clipboard. Non-contiguous selections are separated on the clipboard by a line terminator.

If the user has “Enable copy/cut of current line with no selection active”, then all lines where a non-selection caret is active are copied/cut.

Paste

All selections are overwritten with whatever data is on the clipboard.

Select

Using Shift, the user can select from each caret at once just as he would with a single caret.  

Backspace/Delete

All backspace/delete functionality is available and operates independently upon each caret.

“End of line” carets

Special handling is provided for multiple contiguous “end of line” (EOL) carets.  When this is enabled, the user can hold Ctrl and click and drag BEYOND the EOL for multiple contiguous line and have a caret automatically activated at the end of each line.  This way, the user does not have to manually Ctrl + Click at the end of each line.  If the user continues to drag to a point that is NOT beyond EOL for a line, then the multi-carets will switch over to a regular selection (normal behavior when clicking and dragging).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文