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

Index out of bounds error #101

Open
micahcantor opened this issue Dec 7, 2020 · 5 comments
Open

Index out of bounds error #101

micahcantor opened this issue Dec 7, 2020 · 5 comments

Comments

@micahcantor
Copy link

Describe the bug
ox crashes with an index out of bounds error, when pressing backspace in an empty file.

To Reproduce
Steps to reproduce the behavior:

  1. run ox
  2. press backspace twice
  3. error prints to std out and ox quits

Expected behavior
Ox does not crash when pressing backspace in an empty file

Screenshots
thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', src/document.rs:385:21
stack backtrace:
0: 0x55c15ffc3273 -
1: 0x55c15ff4611c -
2: 0x55c15ffc28d6 -
3: 0x55c15ffc22ca -
4: 0x55c15ffc1b97 -
5: 0x55c15ffc182a -
6: 0x55c15ffc17f4 -
7: 0x55c15ffc17ad -
8: 0x55c15ff438e0 -
9: 0x55c15ff43771 -
10: 0x55c15fed529c -
11: 0x55c15fee6784 -
12: 0x55c15fea7043 -
13: 0x55c15fef0d55 -
14: 0x7fb19de50152 - __libc_start_main
15: 0x55c15fea506e -
16: 0x0 -
Aborted (core dumped)

ox_crash

Desktop (please complete the following information):

  • OS: Arch Linux, latest, kernel 5.9
@tengkuizdihar
Copy link

I've tested it on the master branch and found that it's working fine, no index out of bounds found.

  • OS: Manjaro, kernel 5.4.x

@micahcantor
Copy link
Author

I installed the version from the AUR, and I see the issue about it being out of date, so maybe this has been fixed recently?

@curlpipe
Copy link
Owner

There are several problems with this editor at the moment and I am starting to see a pattern

  1. Distribution - There are so many versions of Ox on different packaging systems and it's quite hard to keep up
  2. Panics - I have failed to test thoroughly enough for these and Ox lacks unit tests, these are also mainly caused by the configuration file.
  3. Missing features - Some features are quite large and would require a total rewrite of Ox itself.

I'm currently thinking up solutions to each of these problems and I'm currently building a Version 0.3.0 of the editor that I'm building from the ground up. I have created this version with several improvements over the 0.2.* codebase:

  1. I'm looking into Github actions and teaching myself how to use all these different package managers to ensure that all copies are up to date.
  2. I've split up the editor into a back end and front end, this allows me to write tests and also design the editor without repeating myself due to the code being cleaner and easier for me to read, therefore allowing me to quickly implement features and patch things because I can isolate them into the front or back end instead of them being fused together. I've already implemented a special test that checks for panics and written my code in a panic-resistant fashion (I've really improved my Rust knowledge over the past few months).
  3. I'm writing a proper language (Oxa is way too buggy) similar to that of Vimscript and elisp where one can configure and write plugins for Ox. (I've been keen to learn proper lexing & parsing techniques and this is a perfect opportunity)

I have no ETA but I'm making hasty progress with this version and I know that it will create a better experience.

@curlpipe
Copy link
Owner

I will also update the AUR package to the latest version now. (forgive me)

@ghost
Copy link

ghost commented Jan 24, 2021

I'm writing a proper language (Oxa is way too buggy) similar to that of Vimscript and elisp where one can configure and write 
plugins for Ox. (I've been keen to learn proper lexing & parsing techniques and this is a perfect opportunity)

why not just use an existing programming language like lua?

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

No branches or pull requests

3 participants