Hello Everyone,
I have installed Sublime Text 3 for coding , it was working fine But suddenly I have observed that on Infinite loop conditions it is getting FREEZE and stopped working and
I could not find any solution to cancel build.I have tried changing the Key binding for cancel build but still I am not able to overcome this issue.
Please suggest some workaround for that as now I have to kill the process from the Task Manger.
Thanks.
The cancel build should rectify this
.
[
{ “keys”: [“ctrl+q”], “command”: “cancel_build” }
]
Try putting this in you key bindings.
@anon49376339 I have changed the keybinding still it is not working.
you can prevent it by using a build system with time out. the following build system will stop the execution after 1 sec (standard time for most of the codechef problems). You can always set the timeout to a higher value if you want to.
build system :-
{
"cmd":["bash", "-c", "g++ -std=c++14 -Wall '${file}' -o '${file_path}/${file_base_name}' && timeout 0.5s '${file_path}/${file_base_name}'"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"variants":
[
{
"name": "Run",
"cmd":["bash", "-c", "g++ -std=c++14 '${file}' -o '${file_path}/${file_base_name}' && timeout 1.0s '${file_path}/${file_base_name}'"]
}
]
}
3 Likes
@arsenic_atg Thanks for reply.
1 Like
Thanks for your reply.I had one doubt where to paste this code snippet since in Key Binding it is not allowing me to add this line.Please help.Sorry for the trouble.
1 Like
just go to Tools->build system->new build system
once new widow opens, erase everything and paste the build system code I provided and save it with the appropriate name.
now all you need to do is to use the new build system(it will be available in the build system list now) to compile and build the code instead of the old one.
1 Like
@arsenic_atg Thanks for helping . I was curious if it will work for Windows Environment as I can see there is some bash command which will execute the build.
When I go to Preferences–>Key Binding : This window is opening and Left Side pannel is not Editable.
hey,i want to say that there are more problems with sublime if you go further for CP in that!
i would like to suggest you some other editor like Dev C++ in cpp and also VS code and you can use atom also.
2 Likes