Browse Source

Minor fixes, but most importingly, added newlines in the opened files.

merge-requests/365/head
eidheim 11 years ago
parent
commit
e166f240b4
  1. 24
      src/files.h
  2. 1
      src/notebook.cc
  3. 2
      src/sourcefile.cc

24
src/files.h

@ -21,18 +21,6 @@ const std::string configjson =
" \"703\": \"own\",\n" " \"703\": \"own\",\n"
" \"705\": \"comment\"\n" " \"705\": \"comment\"\n"
" },\n" " },\n"
" \"extensions\": [\n"
" \"c\",\n"
" \"cc\",\n"
" \"cpp\",\n"
" \"cxx\",\n"
" \"c++\",\n"
" \"h\",\n"
" \"hh\",\n"
" \"hpp\",\n"
" \"hxx\",\n"
" \"h++\"\n"
" ],\n"
" \"visual\": {\n" " \"visual\": {\n"
" \"background\": \"white\",\n" " \"background\": \"white\",\n"
" \"background_selected\": \"blue\",\n" " \"background_selected\": \"blue\",\n"
@ -169,20 +157,20 @@ const std::string snippetpy =
" \"<control><alt>space\") \n" " \"<control><alt>space\") \n"
"snippets = {} \n" "snippets = {} \n"
" \n" " \n"
"snippets[\"for\"] = \"\"\"\ \n" "snippets[\"for\"] = \"\"\"\\\n"
"for(int i=0; i<v.size(); i++) { \n" "for(int i=0; i<v.size(); i++) { \n"
" // std::cout << v[i] << std::endl; \n" " // std::cout << v[i] << std::endl; \n"
" // Write code here \n" " // Write code here \n"
"} \n" "} \n"
"\"\"\" \n" "\"\"\" \n"
" \n" " \n"
"snippets[\"if\"] = \"\"\"\ \n" "snippets[\"if\"] = \"\"\"\\\n"
"if(true) { \n" "if(true) { \n"
" // Write code here \n" " // Write code here \n"
"} \n" "} \n"
"\"\"\" \n" "\"\"\" \n"
" \n" " \n"
"snippets[\"ifelse\"] = \"\"\"\ \n" "snippets[\"ifelse\"] = \"\"\"\\\n"
"if(false) { \n" "if(false) { \n"
" // Write code here \n" " // Write code here \n"
"} else { \n" "} else { \n"
@ -190,19 +178,19 @@ const std::string snippetpy =
"} \n" "} \n"
"\"\"\" \n" "\"\"\" \n"
" \n" " \n"
"snippets[\"while\"] = \"\"\"\ \n" "snippets[\"while\"] = \"\"\"\\\n"
"while(condition) { \n" "while(condition) { \n"
" // Write code here \n" " // Write code here \n"
"} \n" "} \n"
"\"\"\" \n" "\"\"\" \n"
" \n" " \n"
"snippets[\"main\"] = \"\"\"\ \n" "snippets[\"main\"] = \"\"\"\\\n"
"int main(int argc, char *argv[]) { \n" "int main(int argc, char *argv[]) { \n"
" //Do something \n" " //Do something \n"
"} \n" "} \n"
"\"\"\" \n" "\"\"\" \n"
" \n" " \n"
"snippets[\"hello\"] = \"\"\"\ \n" "snippets[\"hello\"] = \"\"\"\\\n"
"#include <iostream> \n" "#include <iostream> \n"
" \n" " \n"
"int main(int argc, char *argv[]) { \n" "int main(int argc, char *argv[]) { \n"

1
src/notebook.cc

@ -2,7 +2,6 @@
#include "logging.h" #include "logging.h"
#include "sourcefile.h" #include "sourcefile.h"
#include "singletons.h" #include "singletons.h"
using namespace std; //TODO: remove
namespace sigc { namespace sigc {
SIGC_FUNCTORS_DEDUCE_RESULT_TYPE_WITH_DECLTYPE SIGC_FUNCTORS_DEDUCE_RESULT_TYPE_WITH_DECLTYPE

2
src/sourcefile.cc

@ -4,7 +4,7 @@
std::string juci::filesystem::open(std::string path) { std::string juci::filesystem::open(std::string path) {
std::string res; std::string res;
for (auto &line : lines(path)) { for (auto &line : lines(path)) {
res += line; res += line+'\n';
} }
return res; return res;
} }

Loading…
Cancel
Save