Skip to content

Commit

Permalink
Bugfix: Pasting passwords during entry editing
Browse files Browse the repository at this point in the history
If the password is shown in plain text while editing an entry and it's (partially) selected, pasting a new value will now properly replace the selection

Closes #5
  • Loading branch information
Rookiestyle committed Jan 6, 2021
1 parent 9c82aa8 commit 5b46e42
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/ColoredSecureTextBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,11 @@ protected override void OnTextChanged(EventArgs e)

protected void Paste(string strData)
{
if (this.SelectionLength > 0)
{
this.SelectedText = strData;
return;
}
int nCursorPos = this.SelectionStart;
string strPre = this.Text.Substring(0, nCursorPos);
string strPost = this.Text.Substring(nCursorPos);
Expand Down
4 changes: 2 additions & 2 deletions src/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// indem Sie "*" wie unten gezeigt eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.11.3")]
[assembly: AssemblyFileVersion("0.11.3")]
[assembly: AssemblyVersion("0.11.4")]
[assembly: AssemblyFileVersion("0.11.4")]
2 changes: 1 addition & 1 deletion version.info
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
:
ColoredPassword:0.11.3
ColoredPassword:0.11.4
ColoredPassword!de:5
ColoredPassword!pl:2
ColoredPassword!ru:2
Expand Down

0 comments on commit 5b46e42

Please sign in to comment.