Check-in [371195c472]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Added a few (extra) debugging lines. Somehow the main thread doesn’t continue when synchronizing from the filter thread (perhaps the main thread isn’t the same thread as the main thread that initializes the plug-in).
Timelines: family | ancestors | descendants | both | v1.3
Files: files | file ages | folders
SHA1:371195c472717c6783204aaf5d06453905e1f7c1
User & Date: Martijn 2013-01-27 11:23:15
Context
2013-01-29
21:49
Merged in the v1.2.1 bugfix check-in: dbaefd1f43 user: Martijn tags: v1.3
2013-01-27
11:23
Added a few (extra) debugging lines. Somehow the main thread doesn’t continue when synchronizing from the filter thread (perhaps the main thread isn’t the same thread as the main thread that initializes the plug-in). check-in: 371195c472 user: Martijn tags: v1.3
2013-01-26
21:41
Running the filter seems to work, reporting errors as well. Only problem now is that the thread synchronization appears to lock up; the (synchronized) displaying of the filtered HTML doesn’t occur until the thread is freed by the next refresh. check-in: 1bb020580b user: Martijn tags: v1.3
Changes

Changes to src/F_PreviewHTML.pas.

174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189

190
191
192
193
194
195
196
    end;

    if IsCustom then begin
//MessageBox(Npp.NppData.NppHandle, PChar(Format('FilterName: %s', [FilterName])), 'PreviewHTML', MB_ICONINFORMATION);
      if ExecuteCustomFilter(FilterName, HTML, BufferID) then begin
        Exit;
      end else begin
        HTML := 'ExecuteCustomFilter returned False';
      end;
    end else if IsXML then begin
      HTML := TransformXMLToHTML(HTML);
    end;

    DisplayPreview(HTML, BufferID);
  except
    on E: Exception do begin

      sbrIE.SimpleText := E.Message;
      sbrIE.Visible := True;
    end;
  end;
end {TfrmHTMLPreview.btnRefreshClick};

{ ------------------------------------------------------------------------------------------------ }







|








>







174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
    end;

    if IsCustom then begin
//MessageBox(Npp.NppData.NppHandle, PChar(Format('FilterName: %s', [FilterName])), 'PreviewHTML', MB_ICONINFORMATION);
      if ExecuteCustomFilter(FilterName, HTML, BufferID) then begin
        Exit;
      end else begin
        HTML := '<pre style="color: darkred">ExecuteCustomFilter returned False</pre>';
      end;
    end else if IsXML then begin
      HTML := TransformXMLToHTML(HTML);
    end;

    DisplayPreview(HTML, BufferID);
  except
    on E: Exception do begin
ODS('btnRefreshClick ### %s: %s', [E.ClassName, StringReplace(E.Message, sLineBreak, '', [rfReplaceAll])]);
      sbrIE.SimpleText := E.Message;
      sbrIE.Visible := True;
    end;
  end;
end {TfrmHTMLPreview.btnRefreshClick};

{ ------------------------------------------------------------------------------------------------ }

Changes to src/U_CustomFilter.pas.

168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
        Exit;

      case OutputMethod of
        cotStandardOutput: begin
          // read the output from the process's standard output stream
          HTML := TStringStream(Output).DataString;
          if Length(HTML) = 0 then
            HTML := '<pre style="color: red">' + StringReplace(Error.DataString, '<', '&lt;', [rfReplaceAll]) + '</pre>';
        end;
        cotInputFile, cotOutputFile: begin
          SS := TStringStream.Create('', FData.Encoding, False);
          try
            SS.LoadFromFile(OutFile);
            HTML := SS.DataString;
          finally







|







168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
        Exit;

      case OutputMethod of
        cotStandardOutput: begin
          // read the output from the process's standard output stream
          HTML := TStringStream(Output).DataString;
          if Length(HTML) = 0 then
            HTML := '<pre style="color: darkred">' + StringReplace(Error.DataString, '<', '&lt;', [rfReplaceAll]) + '</pre>';
        end;
        cotInputFile, cotOutputFile: begin
          SS := TStringStream.Create('', FData.Encoding, False);
          try
            SS.LoadFromFile(OutFile);
            HTML := SS.DataString;
          finally