Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
キャレットモード(モドキ)と、
キャレットヒントモードを追加しました。
モドキの理由は補足にて後述します。
機能概要
キャレットを表示し、操作できるモードです。
キーバインドは、キャレットなので imap 依存にしています。
caret-hint.js のようにヒントの箇所にキャレットを移動するモードです。
使い方
ExtFMode から、
c
押下でキャレットヒントモードに遷移できます。コマンド
:GoExtFMode --caret
でも遷移可能です。ヒント選択後に、キャレットモード(モドキ)へ遷移します。
Escape
でキャレットモードが終了します。コマンド
:GoCaretMode
でも一応キャレットモード(モドキ)に遷移できます。この場合、ドキュメントの先頭にキャレットが表示されます。
補足
document.body.contentEditable
をtrue
にして、ドキュメント全体を編集可能にすることでキャレットを無理矢理表示させているためです。
ドキュメントが編集できてしまうという問題があります。
が、Chrome 自体にキャレットブラウズモードがないので、
こうする以外にキャレットを使う方法が見当たりません……
document.body.spellcheck
をfalse
にしている理由ドキュメント全体を編集可能にした時点で、ドキュメント全体にスペルチェックが走ってしまい、
赤線が表示されてしまうためです。
それを回避するために、いったん
false
にしてキャレットモード終了時に元の状態に戻しています。