Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

文字列をすべて置換したときに表示されるメッセージがおかしいのを対策する #1703

Merged

Conversation

berryzplus
Copy link
Contributor

PR の目的

タイトル通りです。

カテゴリ

  • 不具合修正

PR の背景

詳細は #1701 を見てください。

PR のメリット

不具合が直ります。

PR のデメリット (トレードオフとかあれば)

とくにありません。

仕様・動作説明

CViewCommander::Command_SEARCH_NEXT の引数に渡した文字列が、
CViewCommander::Command_SEARCH_NEXT の処理で書き換わってしまうケースに対策します。

Command_SEARCH_NEXT(リソース文字列)
 👇
検索実行(見つからない、検索初期位置に戻る)
 キャレット位置の変更によりステータスバーが更新され、
 リソース文字列のテンポラリバッファが変更される。
 👇
「見つからないときのメッセージ」を表示すると、意図しないメッセージが表示される。

この修正では、修正量が最小となるように中間バッファを導入しています。

追加して削除しているテストコードは対策検討過程の実験ですが、あえて履歴に残しています。

PR の影響範囲

  • 「見つからないときメッセージを表示」にして「次を検索」した場合に表示されるメッセージに影響します。
  • 「見つからないときメッセージを表示」にして「(次を)置換」した場合に表示されるメッセージに影響します。

テスト内容

置換ダイアログで「置換」を実行して「最後まで置換しました。」が表示される状況を作り出して確認します。

  • 検索一致箇所が2箇所以上存在するドキュメントを用意します。
  • 検索一致箇所が1画面に収まらないように配置します。
  • 置換文字列には検索文字列と一致しない値を入力します。

関連 issue, PR

resolve #1701

参考資料

@sonarcloud
Copy link

sonarcloud bot commented Jul 11, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@AppVeyorBot
Copy link

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@berryzplus
Copy link
Contributor Author

レビューありがとうございます。マージしちゃいます。

@berryzplus berryzplus merged commit aad0b65 into sakura-editor:master Jul 11, 2021
@berryzplus berryzplus deleted the feature/issue1701_workaround branch July 11, 2021 11:22
@beru beru added the 🐛bug🦋 ■バグ修正(Something isn't working) label Oct 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛bug🦋 ■バグ修正(Something isn't working)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

文字列をすべて置換したときに表示されるメッセージがおかしい
3 participants