Skip to content

Instantly share code, notes, and snippets.

@xdegtyarev
Created September 27, 2012 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xdegtyarev/3794208 to your computer and use it in GitHub Desktop.
Save xdegtyarev/3794208 to your computer and use it in GitHub Desktop.
Unity Sublime Runner
//
// main.cpp
// SublimeRunner
//
// Created by Alexander Degtyarev on 9/27/12.
// Copyright (c) 2012 Alexander Degtyarev. All rights reserved.
//
#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <iostream>
int main(int argc, const char * argv[])
{
for (int i = 0; i<argc; i++) {
std::cout << argv[i];
}
std::stringstream command;
command << "open subl -n ";
if(argc > 1)
{
command << "\"" << argv[1] << "\"";
}
if(argc > 2)
{
std::string str(argv[2]);
std::string lineNum = str.substr(6,14);
if(lineNum != "-1"){
command << ":" << lineNum;
}
}
std::cout << command.str();
system(command.str().c_str());
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment