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

improv: Added multiline search/replace and fixed various crashes. #1911

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

paxcut
Copy link
Contributor

@paxcut paxcut commented Sep 20, 2024

Problem description

Previous implementation ignored everything after the first newline. Other changes include:

  • Added isEmpty() function that checks if editor has no content.
  • replaced asserts with default behavior to avoid unneeded crashes.
  • fixed off by one error in DeleteRange()
  • some crashes occurred because readily available corrective actions were not being taken. For example start/end being -1 in DeleteRange().
  • At the heart of search/replace is the ability to translate from indices into the text string to line/column coordinates used for everything. To this end a function (StringIndexToCoordinates) was added to do the translation taking utf-8 chars into account. This made the recently added Utf8BytesToChars function unneeded, so it was removed.
  • Removed commented out code that is not useful anymore. Also removed tooltip code which is also unused.
  • Removed unused parameter wrapAround to FindNext().

paxcut and others added 2 commits September 20, 2024 03:04
Previous implementation ignored everything after the first newline.
Other changes include:
- Added isEmpty() function that checks if editor has no content.
- replaced asserts with default behavior to avoid unneeded crashes.
- fixed off by one error in DeleteRange()
- some crashes occurred because readily available corrective actions were not being taken. For example start/end being -1 in DeleteRange().
- At the heart of search/replace is the ability to translate from indices into the text string to line/column coordinates used for everything. To this end a function (StringIndexToCoordinates) was added to do the translation taking utf-8 chars into account. This made the recently added Utf8BytesToChars function unneeded, so it was removed.
- Removed commented out code that is not useful anymore. Also removed tooltip code which is also unused.
- Removed unused parameter wrapAround to FindNext().
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.

1 participant