Skip to content

Instantly share code, notes, and snippets.

You arrived here because OneCommander crashed or froze in previous session

Find section depending on the action leading to the crash or freezing

Renaming file

There is a bug in Windows that sometimes leads to program freezing when OC asks Windows to rename a file or folder
Several workarounds have been implemented but since I can't reproduce this issue it is not certain which one will fix the problem
To apply workaround open: Settings>Advanced and in Experimental section you will see
Rename freezing workaround section

@jbtule
jbtule / NullCoalesce.fs
Last active May 13, 2022 16:38
Null Coalesce Operator for F# (|??), works with option, Nullable, and c# reference types
//inspired by http://stackoverflow.com/a/2812306/637783
type NullCoalesce =
static member Coalesce(a: 'a option, b: 'a Lazy) = match a with Some a -> a | _ -> b.Value
static member Coalesce(a: 'a Nullable, b: 'a Lazy) = if a.HasValue then a.Value else b.Value
static member Coalesce(a: 'a when 'a:null, b: 'a Lazy) = match a with null -> b.Value | _ -> a
let inline nullCoalesceHelper< ^t, ^a, ^b, ^c when (^t or ^a) : (static member Coalesce : ^a * ^b -> ^c)> a b =
((^t or ^a) : (static member Coalesce : ^a * ^b -> ^c) (a, b))