xeluxee / competitest.nvim

CompetiTest.nvim is a Neovim plugin for Competitive Programming: it can manage and check testcases, download problems and contests from online judges and much more
GNU Lesser General Public License v3.0
417 stars 20 forks source link

Some idea concerning new features #51

Closed XXiaoA closed 6 months ago

XXiaoA commented 7 months ago

Fist of all, I really appreciate this awesome plugin, which do me a big favour. After using it for a while, I have the following ideas to make it better:

xeluxee commented 7 months ago

merge three command about testcases into one command (like testcases simply).

I agree, soon or later I'll do that.

change the color of popup window's boarder (except Testcases window) by the test result, so as to recognise the result at glance. For example, red for wrong test and green for correct one.

This looks like a niche use-case, it's most likely out of scope. Anyway you can get such an effect by defining a custom highlight group, setting floating_border_highlight accordingly, and using a CursorMoved autocommand to fetch line content from testcases buffer and update the custom highlight group.

add something like hook or user event . For instance, i can create build directory before running code to put the binary file into build directory then.

You can already to that:

  compile_directory = "build",
  compile_command = {
    c = { exec = "gcc", args = { "-Wall", "$(FABSPATH)", "-o", "$(FNOEXT)" } },
    cpp = { exec = "g++", args = { "-Wall", "$(FABSPATH)", "-o", "$(FNOEXT)" } },
  },
  running_directory = ".",
  run_command = {
    c = { exec = "build/$(FNOEXT)" },
    cpp = { exec = "build/$(FNOEXT)" },
  },
XXiaoA commented 7 months ago

This looks like a niche use-case

Indeed, after thinking twice, it is not necessary.

You can already to that

Thanks, it works. But I think maybe user event is still a useful function. With it, we can format the code before running, sent notification after finishing the tests etc. ( though i dont need them) It will make the plugin more customizable. What's your opinion? I am not pretty sure if it should be added to.

xeluxee commented 6 months ago

we can format the code before running

By default save_current_file is set to true, so you can format the code before running by enabling format on save (see none-ls wiki).

But I think maybe user event is still a useful function

It could be, but I can't see any useful use-case for it right now. If anyone comes up with good ideas involving the usage of this feature then we'll consider implementing it, maybe as an autocommand.

XXiaoA commented 6 months ago

Thanks, it is clear!