Share your repls and programming experiences

← Back to all posts
A Text Editor in the C++ Console
RomeroSchwarz (267)

I've been learning c++ recently, and decided to take on a text editor. Using the input method that I explained here, I made a pretty rudimentary text editor. It's pretty easy to use, just open a file to read or edit and type away. Press shift + ~ to save and ` to exit. There is already one file included, it's called "test.txt" and contains the word "text".

Commentshotnewtop
CSharpIsGud (415)

https://repl.it/@CSharpIsGud/cpp-text-editor Here is a revised version of this, it handles input and rendering better.
For example when typing into the editor the terminal does not flicker.
However it uses ncurses because repl.it apparently doesn't come with a curses library built in.

sycrepl (10)

Also i really like how you can just type c [name] rather than c then name in another input. Can't tell if that was intended

Andi_Chin (158)

@sycrepl doesn't look like it was intended

MCRusher (2)

@sycrepl you can also type any letter that isn't r and then [name]

because they put

choice == 101 or 99

instead of

choice == 101 or choice == 99

IreoluwaRaufu (200)

Good job here, I've always been interested in C++, but never got into it.

sycrepl (10)

Slight problem, read only mode doesn't make new lines :/

RomeroSchwarz (267)

@sycrepl fixed it, thanks for telling me

Giothecoder (126)

Why do you or 101 by 99 in your compare on line 81

sugarfi (472)

@RomeroSchwarz instead of using the ASCII codes, in C/C++ you can simply type the char literal ('a', 'B', etc.) to get an ASCII code. 'A' == 65, for example.

CSharpIsGud (415)

@RomeroSchwarz in C and C++ char is essentially equivalent to a byte, a lot of projects use them as bytes more than they do as characters

Andi_Chin (158)

really good I like it. you should add vim commands too!