micro-editor / micro-editor/micro

runtime error: index out of range

Open
#1,235 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
29.6k
Forks
1.4k
Avg merge
2d 18h
Merged PRs (30d)
10

Description

Description of the problem or steps to reproduce

After editing files for a while, i start getting this error every time I insert a character or newline:

    runtime error: index out of range
    stack traceback:
    	[G]: ?
    
    Press enter to continue

After exiting this error message, the character is properly inserted.
After this starts happening, the issue is present in all tabs.
I also noticed micro starts using a lot of CPU some of the times.

I started micro with micro -softwrap off -syntax off -mouse off to avoid the usual suspects.
After i save the files, close and reopen them, the issue disappears.

I tried to compile micro myself in hope of a better stackstrace, but it gave me the same result. I don't know how to enable compilation with symbols or whatever the go equivalent might be.

This might be related to issue #1032, but in my case i disabled the mouse. I do however use Shift + (left, right, end or home) to select text quite a lot.

Here are my setting files.

Specifications

Version: 1.4.1
Commit hash: 1856891
Compiled on August 10, 2018
OS: Manjaro Gnome
Terminal: Both Gnome Terminal and Xterm are affected

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the error in micro 1.4.1 with micro -softwrap off -syntax off -mouse off, especially after repeated editing and Shift-based selection. No source file or test is named, so trace the reported index-out-of-range failure and compare behavior across tabs. Done means insertion and newline no longer trigger the error or abnormal CPU use.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.