### snapdragon3101's blog

By snapdragon3101, 7 months ago, ,

# Check : https://cpeditor.org

Hi Guys!

CP Editor met Competitive Companion in 3.0, giving it the ability to parse contests from over 30+ online competitive programming websites. Now, with CP Editor 5.0, it met CF tools, a wonderful tool by xalanq which can do all most everything in code-forces, even submit solutions. Read more about CF tools in his blog.

If you are a pro-user and like vim keybindings, using cf-tools on your favorite terminal with tmux would give your more than what CP Editor has to offer but at the same time, it is very time consuming and difficult to setup on windows.

Let's dive into what is new for us in CP Editor 5.0

• Submit solution to Codeforces from CP Editor, you don't need to copy or upload your solutions manually. Let CP Editor do it for you with just one button click. This feature requires that you have cf-tools installed and you have correctly configured cf-tools. Read the instructions below on how to install and setup cf-tools. Please note the submit button will be only visible in the editor if the problem was parsed by Competitive Companion from code-forces.
Installation and setup of cf-tool

• Set up snippets of codes like Sublime Text, You can add as many snippets as you want in all 3 officially supported languages in CP Editor. You can set up hotkeys for triggering snippets and then search for your snippets and paste it into text editor. You can even rename snippets. Snippets are language defined, you won't find C++ Snippets when your Tab language is set to Python. All snippets are stored inside cp_editor_settings.ini file, which is located in your home directory and contains all the settings of CP Editor. This also, portable and platform independent. In order to inspect it, you can open it like any normal text file.

Big Thanks to ouuan for his work in making snippets available.

• View Modes: CP Editor now has 3 view modes, in Editor mode the complete window of the application will be occupied with Code Editor, in IO Mode complete window will be occupied by Input output boxes and normal mode is called Split Mode, in which window is shared between the two. You can even set hotkeys to toggle the views from Preferences for a quick change of view modes.

• You now have ability to just apply settings. There are three options, "Okay", "Apply" and "Cancel", Okay will close the window and settings will be applied and Apply will keep the preference window open while settings are applied and Cancel will close the preference window.

• There are many other bug fixes and quality of experience improvements. There are some performance improvements too.

#### Support

• else you can open Editor and Help -> Support me, to buy me a coffee

I will be busy with my new semester and also with Google Summer of Code 2020, Hence pace of development will slow down a bit for this project starting today.

### Telegram group for community

You have can discuss, share your views and get helped or help other there.

• +131

By snapdragon3101, history, 7 months ago, ,

# Check : https://cpeditor.github.io

Hi guys!

Happy new year, may this year brings a lot of AC and high ratings to you. This winter break I decided to improve the CP editor and after days and hours of works and thousands of lines of code changes I am glad to present the new CP Editor. Everything has changed, except the functionality. It is now much faster, more professional looking and offers many new features which were highly requested in old versions.

Let's quickly dive into the changes of CP Editor 4.0:

#### What's New

• You can now drag and resize the editor or input boxes, you can also make editor take complete space of window by dragging all the way to right. You can also make Input and other boxes take complete window by dragging all the way to left. You can drag from sides to undo these changes.

• Editor has now 5 themes to choose from (Light (default), Drakula ,Monkai (sublime), Solarised and Solarised Dark). These themes only affect the Editor not the complete application.

• Multi-Tab-Support, You can open and work with as many files as you want all at once. In each tab you can use different language, each tab has its own Input and Output Boxes and they are all independent of one another. I don't have to say more, its amazing.

• You can now parse the complete Contest and each problem with its input and expected output will open in the editor in a new Tab, you can quickly toggle between problems that way. So as soon as the contest starts, click that green button from contest page and all problems from A to G(last) will open in a new tab in the editor. You can quickly just change the language of one Tab by clicking on top right corner, and choosing the new language. This will come in handy when you find that a problem could be better solved with Python than C++.

• Some of you requested that CTRL+Shift+C was too much typing for you to compile your code. So, Now you can set your own keybinding for actions like Compile, Run, Compile Run, Format and Kill. So Change these keys directly by setting them from Preferences. You need to enable hotkeys to enable these changes.

• The Settings were all messed up and the old editor didn't had one place to change all settings. This changed with CP Editor 4.0, now all your settings are placed in one place called Preferences, Open preferences window by clicking on menu bar Options->Preferences and change the settings you want and click apply for changes to take effect. Here is how it looks.

• Editor now shows time of execution on each testcase in milliseconds.

• Editor now correctly highlights numeric literals in C++ like 135u, 3.5f. In older versions, this was not highlighted as literals.

• You can set different template files for different languages. The editor will load them according to the default language you choose.

• When you open a file in editor using Open or right-click->open with, the editor will set its language from the file extension. If it cannot recognize the extension, it will fallback to the default language that you have specified in preferences.

### Notes

This update changes a lot of things and here are few things you should make sure, the compile command of your current language will be no-longer valid. You have to again set the compile command after you update to 4.0. You also need to again set the template file for your language.

System-wide dark theme that was introduced in CP Editor 2.0 has been deprecated and no-longer available in 4.0. Qt does not support Dark theme officially on Windows, so until it does I am not bringing it back. The Dark theme was a big CSS hack that makes Qt Apps look Dark, so to mitigate any UB that may arise due to use of such Hacks, I removed dark theme.

But for Linux users, if you change theme from System Settings, the Editor should change to dark theme that is controlled by your OS. (Tested on KDE Plasma)

You can head over to the release page and download 4.0.3 (latest). Windows users will download the setup file and Any Linux user can download the AppImage and run the file. MAC users, are requested to compile the editor from source. It is difficult for me to package dmg for MAC since I don't own a mac now. Instructions on compiling is available here

### Support

I am a student like most of you, not a corporate person. You can support the project by two ways:

• Spread the word about the Editor, Star the repository and contribute to the project.
• If you are lazy, Download the new Editor Go to Help => Support me and donate.

• +73

By snapdragon3101, 8 months ago, ,

# Check : https://cpeditor.github.io

Hi Guys !

You guys are truly amazing. I created CP Editor around 3 months ago just for fun and personal use, never wanted to make it public but anyways, I decided to make it public with this blog. I got so much love and support that I could not hold myself back from improving it, in following weeks I released the second version in this blog. Fixing a lot of issues and bringing new features.

Let's get into what is new in this release of CP Editor. But first,

#### Merry Christmas programmers!!

Thanks to ouuan for his wonderful contributions. Almost all new features were implemented by him.

#### What's New

• [NEW] Editor now only prompts to save on exit, if unmodified changes are present.
• [NEW] Title-bar shows * for unsaved files.
• [NEW] Verdict now shows colors. WA in Red and AC in Green.
• You can Expand the size of the Input, Output and Message box.
• Now you can Read Input from files in Input boxes.
• Editor now also Optionally accepts Expected Output that you can use to check against your program's stdout.
• Editor also Shows Verdict If you have provided Expected Output. Verdict can be any of three :
• AC : Accepted, Verdict given when Output matches with Expected Output
• WA : Wrong Answer, Verdict given when Output does not matches with Expected Output
• ** : Unknown, Either Expected or Your Program's stdout is Empty.
• Diff viewer has been added to check the difference between the Expected and Produced Output. (Click More to view Diff)
• Set Tab Size.
• Added Competitive Companion in the Editor. So no need to copy paste Input/Output manually, Competitive Companion fetches testcases for you. Set it up as follow :
Setting Competitive Companion

#### What's Fixed

• [New] Fixed Issue when even if expected and produces output were same, the editor still produced WA.
• [New] Fixed an Issue where upon format, there was a chance of command window to blink.
• [New] Fixed Application Crash when Companion Server was restarted.
• [New] Fixed Issue where AppImage would crash on Some Ubuntu 18.04.
• Fixed the issue where { always automatically added a new line with }
• Fixed Tab and Spaces mix-up, in the old version editor always used Spaces for indentation.
• Fixed issue where if user was not opted for beta. Still they get beta update notifications.

#### Troubleshooting and General Information

• Make sure Competitive companion extension port and CP Editor Companion port are same and above 10,000.
• Make sure no other server is listening on the port. If this is the reason you may have to change the port to something else that is not being used.
• Two instances of CP Editor will not be able to run Companion, because only one of them can listen at one port.
• Competitive Companion can also parse Contests. Make sure you are on a problem page when you press parse Task not on a contest page.
• If a problem has more than Sample 3 testcases. The Editor will discard all testcases except first three.
• I have not much experience with Windows, So if your OS has a firewall that prevents CP Editor from listening or request from arriving, you may need to add an exception for the port in your Anti-virus or firewall settings.

###### Support me with Stars**

• +123

By snapdragon3101, history, 8 months ago, ,

# Check : https://cpeditor.github.io

Hi Guys !

Around a week ago, I released the first version of CP Editor. If you are reading about CP Editor for first time. I request you to read my previous blog first.

Many user liked it and I got many suggestions about enhancements and some bug reports as well. I liked your over whelming response, it made me happy. Now it's time for me to make you happy.

Enough talking, let's get into what's new in CP Editor 2.0. It is a big release and hence a long blog ;-)

##### Dark theme

Last time there was a dark theme but it only made the editor dark. So, it wasn't truly dark theme. Now with this new release CP Editor packs a system-wide dark theme. Have a look here

Just like any other software, CP Editor also have a long acyclic dependencies, and over the weeks many were updated. So this Editor has most updated dependencies.

##### Fonts

Fonts are important part of any editor. In the last editor it was not possible to change fonts. In this release you can change font, change font size and change font style. If you want some new font, Install the font to your computer and you can then use it inside the editor. Everything is saved and so your fonts won't change unless you explicitly change them. (requested by : m4xx)

##### Auto Save

I like auto-save feature and use it on all my editors. So in this release you have a option to enable this feature. Auto Save is performed every 5s. So forget CTRL+S after enabling this feature. (requested by : samraj2k)

##### Python is supported

Python is also one of the most widely used language here at Codeforces and is generally used by everyone. Now, you can do all that you could do with C++. Write your few-liner python code and Hit CTRL+R and check your output. Say Bye Bye to Python Interpreter CLI. Python is fully syntax highlighted also Python has Auto completion as well. For setup read here

##### Java is supported

Java is also supported. I didn't disappointed you Java Users. Due to design of Java, you have some restrictions like you have to name your class as a and make it non-public. Syntax Highlighter of C++ is used for this Language so some keywords like instanceof might not get highlighted correctly. In most cases, you won't even notice it. For setup read here

##### Output Box Clear Issue

If you run On Input1 and Input2, the Output1 and Output2 box would get value. If then you cleared Input2 and ran again the old values of Output2 would persist. This issue has been fixed in this release. (reported by : errorgorn)

##### Kill on Timeout

By default editor will now kill all process that would take more than 5 sec to complete. This feature comes in handy when your code is in infinite loop or anything that made your program hung up. The message box will report such kills. This however does not works on Windows due to dependency issue, But don't despair windows user. See next

##### Kill Switch

CTRL+K will kill all running testcases. So if your program hang up. Now you have a nice and tidy way to kill it. The program is sent SIGKILL and hence is bound to get KILLED Immediately. Such process will likely report Non-Zero Exit Code. This was important, because if you keep those process running they would take CPU burst, making your system slow. (requested by : samraj2k)

##### stderr on Crash

Now, if your program crashed or assert failed. You would get such messages on the message box. You can use it to debug by printing stuff to stderr, if program exits abnormally, editor will show all the stderr contents on message box. If program was exited normally, the output box will also show stderr apart from stdout in red color. (requested by : errorgorn)

##### New Session had a bug

A new session is something that resets the state of the editor. Removing all buffers and creating editor like it was launched fresh. However this had a issue where if you opened a file and then after doing your stuff you started a new session, the old file was still kept open and could have been over-written by your new contents. It has been fixed

##### Bracket Matching and Open file name

Now, when your cursor is near a closing bracket, the corresponding opening bracket is highlighted. It looks beautiful in dark mode. See this. Also notice how the currently opened file Path is shown as title of the window. (requested by : ashiknur)

##### Updater

An Updater has been added that checks for newer releases of the editor after every launch of Editor. If a new release is available it will give you a hyperlink to download it. So you can be safe the updates are from me and you always have latest editor installed on your system. Its not annoying updates like Windows, it peacefully requests to update like Linux. See this

##### Open with CP Editor

Windows user can now set CP Editor as their default C++/Python/Java Editor. You can also open any text file in CP Editor by Right click => Open with => Find and click CP Editor.exe. Mark Always if you want to set it as default for file association. In some cases windows might not show CP Editor.exe as candidate for Opening Files, in such case use Let me choose and browse to installation directory and click CP Editor.exe

##### Fixed File Saving

As reported by many, the editor was not able to save a new file. It always saved a null file. This issue has been fixed in this release. (reported by : ashiknur)

##### Detached Mode of Execution

I was aware that in interactive problems this editor will be useless, So this new release has a execution mode called "Detached Execution", You can also run in detach mode by CTRL+Shift+D. When running in detached mode, your process/program is not controlled by Editor. Hence it opens and runs your program in cmd.exe. Here you can interactively put your input. Make sure to pause program, otherwise detached mode closes as soon as your program returns. Detached mode works for all languages. On UNIX you will need to have xterm installed for it to work.

##### Linux AppImages fixed

Due to a higher version of Linux (I use Arch) that i used to pack the editor, those with lower glibc were unable to run the application. It has been fixed, now I am including the glibc inside of AppImage, this increases the size of the App, but Small price to pay for Salvation.

##### Beta and Nightly

Help => Use Beta will enable you to get update notifications for Beta releases of application. This channel is updated every day. So turn this feature if you want to use and be on bleeding edge of CP Editor releases.

Source Code : https://github.com/coder3101/cp-editor2

Please give stars to the project

### EDIT (Update 2.0.2 is available)

• Fixed bug where New Session would not clear the output and input box.
• Fixed Updater, Always showing an Update
• Window size is now restored from last session.
• Added Option to replace tabs with Spaces.
• Editor now shows compiler Warnings.
• Fixed File was not saved unless Editor was closed.

### EDIT 2 (Update 2.0.3 is available)

• A new better contrast icon
• Fixed an Issue where Compiler showed Empty Warning
• Fixed Flashing of Command Window, when You Launch/Update Settings.
• Added, Editor will save your file as soon as you Hit Compile or Run and Compile.
• Fixed, Window not being restored correctly upon re-launch.

• +148

By snapdragon3101, 9 months ago, ,

# This blog is outdated. See https://cpeditor.org

Hi Guys! For the past couple of weeks, I was working on a new Code Editor for Competitive Programmers. Today, I am happy to present it to you all, the first release of CP Editor.

But First, Why we need a new editor?

There exists so many code editor of all types, written in all languages but all of them are tailored down for Development of Software and none is specially focused for Competitive Programming. As competitive Programmers, we need our Editor to be Fast, Reliable and Something that just works. We focus mostly on correctness of our code and this involves compiling and re-running on sample test cases again and again.

CP Editor is Fast written in Native C++ (Qt), Cross-platform (works everywhere), and has all basic features that a competitive programmer needs from an editor. CP Editor takes away your responsibility of compiling the code and running it on your sample test cases. It automatically with just one click or keystroke compiles and runs your program and gives back to you the output.

##### Features
• Code formatting with clang-format or any other tool of your choice.
• Auto-parenthesis, Word Wraps, auto-indentation and all other basic editor features.
• Syntax highlighting for C/C++
• Dark theme for the code editor
##### Limitations
• No support for language other than C/C++ (Sorry Python and Java users, I will try to add these languages ASAP)
• No Auto-complete or Intelli-sense (It makes things slower, learn to remember stuff don't rely on LS too much).
• Highlighting of Closed and its corresponding Open braces is not working. (I am working on it).
##### Installation
• For Windows, you can get the Installer file from here. Install it just as you do with other software.
• For Linux, you can download and run the Editor on any distribution with AppImages. Get it here

This is a code editor and does not come with any Compiler bundled.

So you will need mingW-gcc or clang or msvc on your PATH.

As with every great software, this Editor also comes with all its code open-sourced and you can verify for yourself that your code remains on your machine and never goes anywhere.

The project is available at https://github.com/coder3101/cp-editor2

For complete instructions, setup queries and other issues please refer to the above URL.

Happy Coding !!!

EDIT

If you face any issue regarding VCRUNTIME140_1.DLL MISSING.

Please Install Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019 for your system.

Credits : _quicksand