antirez / kilo

A text editor in less than 1000 LOC with syntax highlight and search.
BSD 2-Clause "Simplified" License
7.42k stars 812 forks source link

Syntax Highlighting Segfault #84

Open StrongerXi opened 2 years ago

StrongerXi commented 2 years ago

How to reproduce

  1. Create any *.c file with 4 empty lines.
  2. Open the file with kilo, go to the 3rd line, press delete twice
  3. Now 2 lines remain, and cursor is at the first line. Move to next line
  4. Enter any character, e.g., a
  5. Segfault

81 resolves this, please consider merging it.

ghost commented 1 year ago

How to reproduce

  1. Create any *.c file with 4 empty lines.
  2. Open the file with kilo, go to the 3rd line, press delete twice
  3. Now 2 lines remain, and cursor is at the first line. Move to next line
  4. Enter any character, e.g., a
  5. Segfault

81 resolves this, please consider merging it.

Annnnnd why don't you just apply the patch to your existing source?