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

fix a ton of bugs (2 still left as an exercise) #78

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

Conversation

rofl0r
Copy link

@rofl0r rofl0r commented Apr 22, 2021

No description provided.

rofl0r and others added 17 commits April 20, 2021 16:36
Was writing `size` chars but the `hl` array was allocated as `rsize` chars.
With `'\` or `"...\` as the last characters on the line, `HL_STRING`
could be written beyond the allocated size of the `hl` array, causing
memory corruption and SEGV.
The test for a keyword would try to read the entire length of each keyword
from the line position even if the rest of the line was too short to
contain that keyword.
A PR was already submitted for this but the author closed it before
it could be merged.
The function `editorRowHasOpenComment()` used its own definition of a
closing multiline comment and duplicated the `hl_oc` member of `struct erow`.
Change to use the latter throughout and thus respect the selected syntax
definition.
del key used to behave just like backspace.
commit is based on d-e-h-i-o@799c743
but works on first char in file and doesnt crash program on last.
since python multiline string/comments start and end with the same
sequence, kilo is unable to figure out which is which once one removes
either one of the start or end markers of the section.
dealing with this would require a quite more elaborate engine than
currently implement, or doing a new syntax scan over the entire file.
for a cursor move that doesnt result in any scrolling, we now simply update
cursor position (and col/row in status bar) to remove the nasty flickering
caused by kilo on xterm when redrawing the entire screen everytime a cursor
is moved.
there's still a bug when moving cursor horizontally inside a long line, in
that it's not detected that the screen needs redraw.
i'll leave the fix to someone else as i'm done with this buggy editor.
@rofl0r
Copy link
Author

rofl0r commented Apr 22, 2021

i'm aware that @antirez won't merge this, i'm putting this here so other people can cherry pick bugfixes or at least get to a state where everything apart from long lines mostly works as it should

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.

3 participants