文字列をすべて置換したときに表示されるメッセージがおかしいのを対策する #1703
Merged
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.
PR の目的
タイトル通りです。
カテゴリ
PR の背景
詳細は #1701 を見てください。
PR のメリット
不具合が直ります。
PR のデメリット (トレードオフとかあれば)
とくにありません。
仕様・動作説明
CViewCommander::Command_SEARCH_NEXT
の引数に渡した文字列が、CViewCommander::Command_SEARCH_NEXT
の処理で書き換わってしまうケースに対策します。Command_SEARCH_NEXT(リソース文字列)
👇
検索実行(見つからない、検索初期位置に戻る)
キャレット位置の変更によりステータスバーが更新され、
リソース文字列のテンポラリバッファが変更される。
👇
「見つからないときのメッセージ」を表示すると、意図しないメッセージが表示される。
この修正では、修正量が最小となるように中間バッファを導入しています。
追加して削除しているテストコードは対策検討過程の実験ですが、あえて履歴に残しています。
PR の影響範囲
テスト内容
置換ダイアログで「置換」を実行して「最後まで置換しました。」が表示される状況を作り出して確認します。
関連 issue, PR
resolve #1701
参考資料