Skip to content

Commit

Permalink
Merge pull request #1445 from lbartoletti/freebsd_support
Browse files Browse the repository at this point in the history
Freebsd support
  • Loading branch information
fox0430 authored Oct 20, 2021
2 parents 3658d67 + 13a2c83 commit 8c3e5ab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/moepkg/exmode.nim
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,10 @@ proc startHistoryManager(status: var Editorstatus) =
proc startRecentFileMode(status: var Editorstatus) =
status.changeMode(currentBufStatus.prevMode)

# :recent is only supported on GNU/Linux
if CURRENT_PLATFORM != Platforms.linux: return
# :recent is only supported on Unix or Unix-like (BSD and Linux)
if not (CURRENT_PLATFORM == Platforms.linux or
CURRENT_PLATFORM == Platforms.freebsd or
CURRENT_PLATFORM == Platforms.openbsd): return

if not fileExists(getHomeDir() / ".local/share/recently-used.xbel"):
status.commandLine.writeOpenRecentlyUsedXbelError(status.messageLog)
Expand Down
6 changes: 5 additions & 1 deletion src/moepkg/platform.nim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import osproc, strutils

type Platforms* = enum
linux, wsl, mac, other
linux, wsl, mac, freebsd, openbsd, other

proc initPlatform(): Platforms =
if defined linux:
Expand All @@ -10,6 +10,10 @@ proc initPlatform(): Platforms =
else: result = Platforms.linux
elif defined macosx:
result = Platforms.mac
elif defined freebsd:
result = Platforms.freebsd
elif defined openbsd:
result = Platforms.openbsd
else:
result = Platforms.other

Expand Down

0 comments on commit 8c3e5ab

Please sign in to comment.