snapdragon3101's blog

By snapdragon3101, 2 weeks ago, In English,

This version has been superseded by CP Editor 2.0. Read more about it here

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

 
 
 
 
  • Vote: I like it
  • +194
  • Vote: I do not like it

»
2 weeks ago, # |
  Vote: I like it +1 Vote: I do not like it

Great Software Bruh! Loved it. Its easy to use and also lightweight. Takes less time to compile and run. Dark Mode is awesome. More than two input files can run together and in just a very few seconds, we can see the output as well. From today onwards, I will use this software to write codes for cp questions.

»
2 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Hi! I installed the precompiled setup for Windows but I am having trouble running it.

After installing when I first tried to run CP-Editor, an error message popped up saying

VCRUNTIME140_1.dll is missing.

I downloaded the DLL file but now it shows a different error -

The procedure entry point __CxxFrameHandler4 could not be located in the dynamic link library.

Please fix.

»
2 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

I have not used the app however there's a suggestion from my side to use single key for run(maybe F10) and compile & run(F9). Small improvement but makes a huge diff.

  • »
    »
    2 weeks ago, # ^ |
      Vote: I like it +6 Vote: I do not like it

    In some future release I will provide a way to customize the shortcut keys. But Even having F10 or F5 still requires pressing Fn Keys. In most of the newer laptop the Function keys by default perform operations like volume Up, brightness and stuff, unless the behavior is changed from BIOS.

    I thought if it needs 2 keys anyways, why not make it easy to reach key like Ctrl+R to run.

»
2 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

I have installed it but it failed to start compiler process.

What we need to enter in Compile Command, Run Command, Format Command

  • »
    »
    2 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    First you need to have a compiler installed. Install mingW-gcc. Then add it to your PATH (Environment variable). To verify if everything went well open a command prompt and run g++ --version it should return the version. Now go to editor setting and write compile command like g++ -Wall and now you should be able to compile.

    As for format command leave it default and run command also can be left as default.

    Note Incase you already had DevCpp installed. You most likely have g++ installed. Simply navigate to the directory you installed DevCpp and inside of it you should find a directory named mingw, add this mingw/bin to environment variable and everything should work.

    In a nutshell add any C++ compiler to your environment PATH.

»
2 weeks ago, # |
Rev. 2   Vote: I like it +1 Vote: I do not like it

Very good IDE for competitive programming purposes, but please implement some form of variable autocomplete. When upsolving I like to use long, descriptive variable names, and autocomplete is very useful.

»
2 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

can't checkout the check box for comparing expected output. how can i do that?

  • »
    »
    2 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    That feature was kind of broken. So i disabled that check box. In future release i will re-enable it.

»
2 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

I downloaded the file on Linux and I also gave necessary permissions but it's still not working when I double click it. Am I missing something?

  • »
    »
    2 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    try ./CPEditor.AppImage after chmod a+x

    • »
      »
      »
      2 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      No It's still not working.

      • »
        »
        »
        »
        2 weeks ago, # ^ |
        Rev. 2   Vote: I like it 0 Vote: I do not like it

        So what is the error that comes when you run the execute command. Anything specific?

        Also your distro and OS please?

        • »
          »
          »
          »
          »
          2 weeks ago, # ^ |
          Rev. 2   Vote: I like it 0 Vote: I do not like it

          I have ubuntu and I typed this in my terminal "./CP_Editor-1.50.2-x86_64.AppImage" and it is saying "./CP_Editor-1.50.2-x86_64.AppImage: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /tmp/.mount_CP_Edi2gRLA6/lib/libicuuc.so.65)"

          • »
            »
            »
            »
            »
            »
            13 days ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            It seems that you need to upgrade to Ubuntu Disco or Eoan. Otherwise you won't have the required libc version.

          • »
            »
            »
            »
            »
            »
            9 days ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            Yes, I packaged the AppImage on Arch Linux with latest glibc. You could either upgrade or wait for next release where i will use some older libc to package the AppImage.

»
2 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

how can i see the name of my current file? and how can i open two file at a time?

  • »
    »
    2 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    For opening 2 files at one time. You can open two instances of editor. As for the name of file you have opened, editor does not shows it. (Maybe I will add this feature).

»
2 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

This Is toooooooo good. I loved the dark theme.

»
2 weeks ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

i think save option isn't working at all. it saves a null file. it saves file when application closed.

»
2 weeks ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

An error popped out while trying to run my program:

Unsupported 16-Bit Application

The program or feature "\??\C:\Users\USER\AppData\Local\Temp\a.exe" cannot start or run due to incompatibility with 64-bit versions of Windows. Please contact the software vendor to ask if a 64-bit Windows compatible version is available.

  • »
    »
    2 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Are you using a Cross compiler. The gcc or compiler you have used in compile command is most likely to be old and is producing 16 bit binaries. Use a different compiler the one compatible with your system.

    • »
      »
      »
      2 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      My compiler is called "GNU GCC Compiler" as in Code::Blocks 17.12. I've been using this compiler at Code::Blocks and it works fine (assume that it means my compiler is compatible with my system).

      I think the problem may be my compile command: g++ -Wall -fexceptions -g -O3 -std=c++14 -c. I'm not familiar with writing compile commands, since Code::Blocks automates it, so I think that there's something wrong with my compile command.

      For reference, I'm using a 64-bit Windows 7 Professional.

      • »
        »
        »
        »
        9 days ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Reset the settings. Keep g++ -Wall as compile command.

        • »
          »
          »
          »
          »
          7 days ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          So I tested the editor on another code today, and the error above no longer shows up. Instead I saw this at the Compiler Messages:

          [09:32:43] [Runner[1]] [Error occurred during execution on first testcase]

          right after I run my code. The same error occurred for all the inputs I've specified. I've then changed my compile command into g++ -Wall but that doesn't seem to change anything.

          Is there a way I can reset all the settings other than uninstalling and reinstalling the editor?

          • »
            »
            »
            »
            »
            »
            7 days ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            There will be a file in your home directory (in case of windows : C:/Users/your_name) named cp_editor_settings.ini. Delete it or you can also reset all settings from Help => Reset Settings

            If problem persist, try disabling your Antivirus which maybe preventing your executable from running. For that check to C:/Users/name/AppData/Local/Temp directory a file named a.exe, if it exists try running it by double clicking it, does it starts. (a.exe will exist only after compilation was okay)

            • »
              »
              »
              »
              »
              »
              »
              7 days ago, # ^ |
                Vote: I like it 0 Vote: I do not like it

              It's finally working. Thanks!

              Hope that the issue with file saving will be fixed soon. :)

»
2 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Can you add the font changing

»
2 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

I didn't understand it -> Code formatting with clang-format or any other tool of your choice In Codeblocks Code can be format A style how I gonna make this happen in this editor. You know sometimes codes are too large and if there a format option then it will be helpful for me. Thanks in advance for your this beautiful creature buddy .

  • »
    »
    2 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Install llvm, it will install clang-format and while installing choose add to PATH. Now change format command to clang-format -i. Press CTRL+ALT+L to format the code.

»
2 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Can it run on macOS?

  • »
    »
    2 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I have not packaged it for MacOS, but it should run on MacOS. Install QT for Mac and then compile it yourself. (won't take more than 2 min). Follow the instructions on project url

»
2 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Very good editor for cp

»
13 days ago, # |
  Vote: I like it 0 Vote: I do not like it

An interesting feature would be merging it with cftools by xalanq, so the editor may automatically crawl sample cases from cf rounds and submit solutions (maybe use it as an extension).

  • »
    »
    10 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I will add this feature in some far future release. At this moment i am making it more stable by adding more language like Python (interpreted lang) and Java (VM run Lang). I have added those for future release.

»
10 days ago, # |
  Vote: I like it +4 Vote: I do not like it

This is very good app, but just a suggestion to clear all the output boxes everytime we rerun the program and also to print stuff to the output boxes even if the program crashed for people who uses print messages to debug

  • »
    »
    10 days ago, # ^ |
      Vote: I like it +8 Vote: I do not like it

    I have added this feature in new release. If your program crashes everything in the stderr will be printed out to output box with red color.

»
10 days ago, # |
  Vote: I like it +3 Vote: I do not like it

The editor starts "Not responding" for large input, there should be a button to kill the compliation and run. Rest its amazing!!!!

  • »
    »
    10 days ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    Large input to stdin?. As for stopping compilation if an compilation was active and you again press compile button. The old would get killed a new would start. Making sure that editor only executes one compiler process at a time. Yes, a button to killing a running executable would be nice. I already added a killtimer. So if your process hang up. Say in some infinite loop. The editor will kill the process after 5 sec. (It doesn't seem to work on windows but works on my linux)

    • »
      »
      »
      9 days ago, # ^ |
        Vote: I like it +8 Vote: I do not like it

      Oh! I am using in Windows.

      Some constructive suggestions:

      • An Autosave feature will be very nice!!!!
      • Resizable output window.
      • Kill timer for Windows too :)

      Hats off for your work!

»
9 days ago, # |
  Vote: I like it 0 Vote: I do not like it

I have installed it. I have also installed mingw compiler , now what should I write in change compile command?

  • »
    »
    9 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Add gcc/g++ to PATH and No change required to setting

  • »
    »
    9 days ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    g++ -std=c++14 -static -Weffc++ -s

    Here if you want to use auto, in case your compiler is not in C++ 14 settings

»
9 days ago, # |
  Vote: I like it +1 Vote: I do not like it

This editor is amazing! I just tried it in a virtual contest, and it really makes editing and debugging code much faster. I liked that it can run my program on 3 test cases at the same time. And it is super fast compared to Code::Blocks, which I used before.

»
7 days ago, # |
  Vote: I like it 0 Vote: I do not like it

When i use character '{' and '}' to make pair, it auto create new line and i don't want it. So can you just create '}' when I type '{' and make create new line as option.

  • »
    »
    7 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Yes, I know it is a Dependency issue. I will open an issue with the dependency. Meanwhile, You can avoid it by using vec.emplace_back(2,3) instead of vec.push_back({2,3}).

  • »
    »
    47 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    It should create a new line on pressing Enter.

»
46 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Good editor