Skip to content

Conversation

@ossilaukkanen
Copy link
Contributor

Search function (find, find next, replace, replace all) now doesn't
differentiate between lower-cases and upper-cases. Previously couldn't
find the word "Example" when "example" was typed into the search field.

Search function (find, find next, replace, replace all) now doesn't
differentiate between lower-cases and upper-cases. Previously couldn't
find the word "Example" when "example" was typed into the search field.
@pH-7
Copy link
Owner

pH-7 commented Oct 23, 2015

Hi Fitoh! Thanks for the contribution!! Seems perfect. However, I can't test it right now. Did you test it (and on what Java version?). Is that works well?

@ossilaukkanen
Copy link
Contributor Author

Hi, tested it in jdk 1.7 (and using NetBeans). Works as it should, I couldn't find any bugs related to my change.

There are other bugs however that are still present, mainly one in Replace function. When you try to replace a word that is not present in the text, the program adds to the end of the text the word you wanted to replace the original word with.
For example: text field: "This contains text."
Find field: "searchThisWord"
Replace field: "replaceItWithThisWord"
you hit the replace button and the text field now reads: "This contains text.replaceItWithThisWord"

This particular bug is however present in the current version, so it doesn't have anything to do with the changes I made.

@pH-7
Copy link
Owner

pH-7 commented Oct 24, 2015

Okay I'll merge it very soon!
Thanks for reporting the other issue!
Concerning that bug, as I can see it's because in replace method, it doesn’t check if the string to replace exists or not. It should check like that just after find.

if(select_start != -1)

This (or thing like) should be OK, please let me know.

Fixed a bug where replace function simply added the replace word to the
end of the text when it failed to find the original word that was to be
replaced.
Fixed a bug where replace function simply added the replace word to the
end of the text when it failed to find the original word that was to be
replaced.
@ossilaukkanen
Copy link
Contributor Author

Fixed the replace bug (and tested the fix). Sorry about the 2 & 3 commit, didn't notice the automatic changes to project.properties so had to revert to make those go away. The current (4th) commit is OK with both non case sensitivity and the replace bug fixed.

@pH-7
Copy link
Owner

pH-7 commented Oct 24, 2015

👍 That's brilliant! Thanks Fitoh to contribute 😃

pH-7 added a commit that referenced this pull request Oct 24, 2015
Made search function non case-sensitive
@pH-7 pH-7 merged commit 6810c06 into pH-7:master Oct 24, 2015
@ossilaukkanen
Copy link
Contributor Author

Glad I could. The compiled jar file is old version though, but I leave that to you if you want to update it at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants