Commit 23701448 authored by Dimitri van Heesch's avatar Dimitri van Heesch
Browse files

Merge pull request #256 from albert-github/feature/bug_first_line_inline

Extra empty line in source fragments
parents 772046d4 79b40a43
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -755,6 +755,7 @@ bool readCodeFragment(const char *fileName,
    {
    {
      while ((c=fgetc(f))!='\n' && c!=EOF) /* skip */;
      while ((c=fgetc(f))!='\n' && c!=EOF) /* skip */;
      lineNr++; 
      lineNr++; 
      if (found && c == '\n') c = '\0';
    }
    }
    if (!feof(f))
    if (!feof(f))
    {
    {
@@ -763,7 +764,7 @@ bool readCodeFragment(const char *fileName,
      while (lineNr<=endLine && !feof(f) && !found)
      while (lineNr<=endLine && !feof(f) && !found)
      {
      {
        int pc=0;
        int pc=0;
        while ((c=fgetc(f))!='{' && c!=':' && c!=EOF) 
        while ((c=fgetc(f))!='{' && c!=':' && c!=EOF)  // } so vi matching brackets has no problem
        {
        {
          //printf("parsing char `%c'\n",c);
          //printf("parsing char `%c'\n",c);
          if (c=='\n') 
          if (c=='\n') 
@@ -816,7 +817,7 @@ bool readCodeFragment(const char *fileName,
          result+=spaces;
          result+=spaces;
        }
        }
        // copy until end of line
        // copy until end of line
        result+=c;
        if (c) result+=c;
        startLine=lineNr;
        startLine=lineNr;
        if (c==':') 
        if (c==':') 
        {
        {