1
0
Fork 0

Compare commits

..

No commits in common. "289d6ebc436c5f03cb0785c529657e89e3144e11" and "fca62c245fa1fb546c15849d64c7be7b095539e7" have entirely different histories.

2 changed files with 10 additions and 17 deletions

View File

@ -78,9 +78,9 @@ For some platforms, you will need to refer to [the installation guide](https://w
The free data files, split into OpenGFX for graphics, OpenSFX for sounds and The free data files, split into OpenGFX for graphics, OpenSFX for sounds and
OpenMSX for music can be found at: OpenMSX for music can be found at:
- [OpenGFX](https://www.openttd.org/downloads/opengfx-releases/latest) - https://www.openttd.org/downloads/opengfx-releases/latest for OpenGFX
- [OpenSFX](https://www.openttd.org/downloads/opensfx-releases/latest) - https://www.openttd.org/downloads/opensfx-releases/latest for OpenSFX
- [OpenMSX](https://www.openttd.org/downloads/openmsx-releases/latest) - https://www.openttd.org/downloads/openmsx-releases/latest for OpenMSX
Please follow the readme of these packages about the installation procedure. Please follow the readme of these packages about the installation procedure.
The Windows installer can optionally download and install these packages. The Windows installer can optionally download and install these packages.

View File

@ -247,21 +247,14 @@ void Textbuf::DeleteText(uint16_t from, uint16_t to, bool update)
this->bytes -= to - from; this->bytes -= to - from;
this->chars -= c; this->chars -= c;
auto fixup = [&](uint16_t &pos) {
if (pos <= from) return;
if (pos <= to) {
pos = from;
} else {
pos -= to - from;
}
};
/* Fixup caret if needed. */ /* Fixup caret if needed. */
fixup(this->caretpos); if (this->caretpos > from) {
if (this->caretpos <= to) {
/* Fixup marked text if needed. */ this->caretpos = from;
fixup(this->markpos); } else {
fixup(this->markend); this->caretpos -= to - from;
}
}
if (update) { if (update) {
this->UpdateStringIter(); this->UpdateStringIter();