1

I want to run pascal code in Sublime Text (Sublime Text 2) in OS X Mavericks.

I find this sublime-build that work and run in windows. (Created by Qwerty. https://stackoverflow.com/users/985454/qwerty)

{
   "cmd": ["fpc", "${file_path}/${file_base_name}"],
   "selector": "source.pascal",
   "variants": [
    {
        "cmd": ["start", "cmd", "/c", "$file_base_name.exe & pause"],
        "name": "Run",
        "shell": true
    }
   ]
}

but I don`t know how to modify it to work in OS X.

My test is a simple Hello World:

Program HelloWorld;
begin
   writeln("Hello, world!");
   readln;
end.
Community
  • 1
  • 1
Txutxi
  • 11
  • 2

1 Answers1

0

Try

{
   "cmd": ["fpc", "${file_path}/${file_base_name}"],
   "selector": "source.pascal",
   "variants": [
    {
        "cmd": ["open -a Terminal.app '${file_path}/${file_base_name}'"],
        "name": "Run",
        "shell": true
    }
   ]
}

Also, your "Hello, World!" program should use a single-quoted string:

Program HelloWorld;
begin
   writeln('Hello, world!');
   readln;
end.
nwk
  • 4,004
  • 1
  • 21
  • 22