micro-editor / micro-editor/micro

[Bug] Issue with copypasting large volumes of tabbed text

Open
#3,952 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

Take the following code:

void main()
{
    import std.algorithm, std.stdio;

    "Starting program".writeln;

    enum a = [ 3, 1, 2, 4, 0 ];
    // Sort data at compile-time
    static immutable b = sort(a);

    // Print the result _during_ compilation
    pragma(msg, "Finished compilation: ", b);
}

Open micro on windows cmd

Image

Now paste the code into the program. Output you get:

Image

This is not supposed to be the output. I assume there is some bug with the \r operation (return to start) while printing to the terminal in Windows. So it is printing to the same tablevel it already was + adding any prior tab levels which causes line by line increase in tablevels. This is consistent across all programming languages and not just Dlang.

Output is supposed to be like this:

Image Image

(latest version of micro used)

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

Reproduce the issue in micro on Windows Command Prompt by pasting the provided tabbed D code and compare the resulting alignment with the expected screenshots. Start by tracing the terminal input and rendering paths responsible for pasted newlines, carriage returns, and tabs; done means large pasted blocks keep their original indentation without cumulative shifts.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli, operating-systems
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.