diff --git a/wox.core/util/log.go b/wox.core/util/log.go index 13ecf2daf..e3630e71a 100644 --- a/wox.core/util/log.go +++ b/wox.core/util/log.go @@ -28,19 +28,22 @@ func GetLogger() *Log { logOnce.Do(func() { logFolder := GetLocation().GetLogDirectory() logInstance = CreateLogger(logFolder) - setCrashOutput() + setCrashOutput(logInstance) }) return logInstance } -func setCrashOutput() { +func setCrashOutput(logInstance *Log) { logFile := path.Join(GetLocation().GetLogDirectory(), "crash.log") crashFile, err := os.Create(logFile) if err != nil { panic(err) } - debug.SetCrashOutput(crashFile, debug.CrashOptions{}) + setCrashOutputErr := debug.SetCrashOutput(crashFile, debug.CrashOptions{}) + if setCrashOutputErr != nil { + logInstance.Error(context.Background(), fmt.Sprintf("failed to set crash output: %s", setCrashOutputErr.Error())) + } } func CreateLogger(logFolder string) *Log { diff --git a/wox.ui.flutter/wox/lib/components/wox_preview_view.dart b/wox.ui.flutter/wox/lib/components/wox_preview_view.dart index 2be6eadef..434f15f85 100644 --- a/wox.ui.flutter/wox/lib/components/wox_preview_view.dart +++ b/wox.ui.flutter/wox/lib/components/wox_preview_view.dart @@ -78,9 +78,9 @@ class _WoxPreviewViewState extends State { } Widget buildText(String txtData) { - return Scrollbar( - child: SingleChildScrollView( - controller: scrollController, + return SingleChildScrollView( + controller: scrollController, + child: Scrollbar( child: SelectableText( txtData, style: TextStyle(color: fromCssColor(widget.woxTheme.previewFontColor)),