Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upFeature: Town name filtering #6983
Conversation
Thanks for your contribution! Overall it looks good, there's a few things you should change, mostly cosmetic. You also need to change the commit message to follow the scheme used, always starting with a keyword (like Add, Change, Fix), a colon, and then the message. Do this with a commit amend in Git, and force-push your branch. (Amending and force-pushing is often frowned upon, but necessary in this case. Github handles it correctly and updates the PR.) |
This comment has been minimized.
This comment has been minimized.
@nielsmh Thanks for your kind comments. I've corrected, is it okay? |
This comment has been minimized.
This comment has been minimized.
I don't have anything more for now. Will find time to test it later :) |
This comment has been minimized.
This comment has been minimized.
Thanks for the PR. |
This comment has been minimized.
This comment has been minimized.
@J0anJosep Thanks for your notice, I committed, is it right? |
This comment has been minimized.
This comment has been minimized.
You'll want to rebase & force-push to merge the commits together, but that's the right idea |
This comment has been minimized.
This comment has been minimized.
It looks nice. However the sorting doesn't seem to be stable even when I do not change input into the search box (anymore). The resulting list flickers and changes order randomly for me. That doesn't happen with the full list where the entries immediately follow eachother. I currently can only speculate as to the reasons: I assume a sub-list is generated from the whole list - and display sometimes happens before sorting, but after generation of the sub-list - but most times it happens correctly after sub-list generation and its sorting. Looks to me you already consider only re-generating the list, when the input field actually changed, though. Honestly I'm not sure whether this, my observation, is beyond the scope of this patch which just makes use of the existing sort framework. I lean toward "out-of-scope" - yet this makes a bug or race condition visible. |
As per @planetmaker's comments |
This comment has been minimized.
This comment has been minimized.
@planetmaker Thanks for your comment, even though I cannot understand 100% what you're meant to because of my lack of english/coding skills. |
telk5093 commentedNov 27, 2018
•
edited
It's my first OpenTTD PR, and please let you know I'm very new to c++ and openttd's codes.
I referenced this code from town_gui.cpp and other's PR and it works, but very strangely.
So please advice your enhanced code, and you can ignore/edit this commit.
This allows filtering town names like below:
