Skip to content

Commit

Permalink
Merge pull request #1458 from fox0430/fix-import
Browse files Browse the repository at this point in the history
Fix import and bump nim version
  • Loading branch information
fox0430 authored Dec 16, 2021
2 parents d191e8a + 01e96e5 commit 8262e9b
Show file tree
Hide file tree
Showing 81 changed files with 104 additions and 99 deletions.
2 changes: 1 addition & 1 deletion moe.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ bin = @["moe"]

# Dependencies

requires "nim >= 1.4.2"
requires "nim >= 1.6.0"
requires "ncurses >= 1.0.2"
requires "unicodedb >= 0.10.0"
requires "parsetoml >= 0.6.0"
Expand Down
2 changes: 1 addition & 1 deletion src/moe.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import os, times
import std/[os, times]
import moepkg/[ui, editorstatus, normalmode, insertmode, visualmode,
replacemode, filermode, exmode, buffermanager, logviewer,
cmdlineoption, bufferstatus, help, recentfilemode, quickrun,
Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/backup.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import os, times, re
import std/[os, times, re]
import settings, unicodeext, fileutils, bufferstatus, gapbuffer, messages,
commandline

Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/bookmark.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import os
import std/os

type Bookmark* = object
path*: string
Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/buffermanager.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import terminal, os, heapqueue, times
import std/[terminal, os, heapqueue, times]
import gapbuffer, ui, editorstatus, unicodeext, highlight, window, movement,
color, bufferstatus

Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/bufferstatus.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import tables, times, options
import std/[tables, times, options]
import syntax/highlite
import gapbuffer, unicodeext

Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/build.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import os, osproc, strformat, unicode
import std/[os, osproc, strformat, unicode]
import syntax/highlite

proc build*(filename, workspaceRoot,
Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/clipboard.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import unicode, os
import std/[unicode, os]
import independentutils, platform, settings

proc runesToStrings(runes: seq[seq[Rune]]): string =
Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/cmdlineoption.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import parseopt, pegs, os, strformat
import std/[parseopt, pegs, os, strformat]

type CmdParsedList* = object
path*: seq[string]
Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/color.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import std/[strutils, tables, macros, strformat]
import ncurses
import strutils, tables, macros, strformat

# maps annotations of the enum to a hexToColor table
macro mapAnnotationToTable(args: varargs[untyped]): untyped =
Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/commandline.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import terminal
import std/terminal
import ui, unicodeext, color

type CommandLine* = object
Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/commandview.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import terminal, strutils, sequtils, strformat, os, algorithm
import std/[terminal, strutils, sequtils, strformat, os, algorithm]
import ui, unicodeext, fileutils, color, commandline

type ExModeViewStatus = object
Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/configmode.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import terminal, times, strutils
import std/[terminal, times, strutils]
import gapbuffer, ui, editorstatus, unicodeext, window, movement, settings,
bufferstatus, color, highlight, search, editor

Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/cursor.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import deques, strformat
import std/[deques, strformat]
import editorview, unicodeext

type CursorPosition* = object
Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/debugmode.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import terminal, times, strformat, options
import std/[terminal, times, strformat, options]
import gapbuffer, ui, unicodeext, highlight, color, window, bufferstatus,
movement, settings

Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/diffviewer.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import times, terminal
import std/[times, terminal]
import editorstatus, unicodeext, bufferstatus, highlight, color, gapbuffer, ui,
movement, window

Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/editor.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import strutils, sequtils, strformat, options
import std/[strutils, sequtils, strformat, options]
import syntax/highlite
import editorstatus, ui, gapbuffer, unicodeext, undoredostack, window,
bufferstatus, movement, messages, settings, register, commandline
Expand Down
8 changes: 4 additions & 4 deletions src/moepkg/editorstatus.nim
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import strutils, terminal, os, strformat, tables, times, heapqueue, deques,
options
import std/[strutils, terminal, os, strformat, tables, times, heapqueue, deques,
options]
import syntax/highlite
import gapbuffer, editorview, ui, unicodeext, highlight, fileutils,
undoredostack, window, color, settings, statusline, bufferstatus, cursor,
tabline, backup, messages, commandline, register, platform
window, color, settings, statusline, bufferstatus, cursor, tabline,
backup, messages, commandline, register, platform

# Save cursor position when a buffer for a window(file) gets closed.
type LastPosition* = object
Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/editorview.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import deques, strutils, math, strformat
import std/[deques, strutils, math, strformat]
import gapbuffer, ui, unicodeext, independentutils, color, settings,
bufferstatus, highlight

Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/exmode.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import sequtils, strutils, os, terminal, times, options
import std/[sequtils, strutils, os, terminal, times, options]
import syntax/highlite
import editorstatus, ui, normalmode, gapbuffer, fileutils, editorview,
unicodeext, independentutils, search, highlight, commandview,
Expand Down
10 changes: 6 additions & 4 deletions src/moepkg/filermode.nim
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import os, terminal, strutils, unicodeext, times, algorithm, sequtils, options
import std/[os, terminal, strutils, times, algorithm, sequtils,
options]
import editorstatus, ui, fileutils, editorview, gapbuffer, highlight,
commandview, window, color, bufferstatus, settings, messages, commandline
commandview, window, color, bufferstatus, settings, messages,
commandline, unicodeext

type PathInfo = tuple[kind: PathComponent,
path: string,
Expand Down Expand Up @@ -76,8 +78,8 @@ proc sortDirList(dirList: seq[PathInfo], sortBy: Sort): seq[PathInfo] =
result.add dirList.sortedByIt(it.lastWriteTime)

when defined(posix):
from posix import nil
from posix_utils import nil
from std/posix import nil
from std/posix_utils import nil

proc isFifo(file: string): bool {.inline.} =
posix.S_ISFIFO(posix_utils.stat(file).st_mode)
Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/fileutils.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import os, encodings
import std/[os, encodings]
import gapbuffer, unicodeext

proc normalizePath*(path: seq[Rune]): seq[Rune] =
Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/gapbuffer.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import macros, strformat
import std/[macros, strformat]
import undoredostack
export undoredostack

Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/generalautocomplete.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import sugar, critbits, options
import std/[sugar, critbits, options]
import unicodedb/properties
import unicodeext, bufferstatus

Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/help.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import terminal
import std/[terminal]
import editorstatus, bufferstatus, ui, movement, unicodeext, gapbuffer, window

const helpsentences = """
Expand Down
4 changes: 2 additions & 2 deletions src/moepkg/highlight.nim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sequtils, os, strformat, parseutils
import std/[sequtils, os, strformat, parseutils]
import syntax/highlite
import unicodeext, color
from strutils import find
from std/strutils import find

type ColorSegment* = object
firstRow*, firstColumn*, lastRow*, lastColumn*: int
Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/historymanager.nim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# History manager for automatic backup.

import re, os, times, terminal, osproc
import std/[re, os, times, terminal, osproc]
import editorstatus, bufferstatus, unicodeext, ui, movement, gapbuffer,
highlight, color, settings, messages, backup, commandview, fileutils,
editorview, window
Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/independentutils.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import strutils, math, random, osproc
import std/[strutils, math, random, osproc]

proc numberOfDigits*(x: int): int {.inline.} = x.intToStr.len

Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/insertmode.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import terminal, times, options, unicode
import std/[terminal, times, options, unicode]
import ui, editorstatus, gapbuffer, window, movement, editor, bufferstatus,
suggestionwindow, settings

Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/logviewer.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import terminal, times
import std/[terminal, times]
import ui, editorstatus, unicodeext, movement, bufferstatus, window

proc exitLogViewer*(status: var Editorstatus, height, width: int) {.inline.} =
Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/messages.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import strformat, os, strutils
import std/[strformat, os, strutils]
import color, unicodeext, settings, commandline, independentutils

proc writeMessageOnCommandWindow*(commandLine: var CommandLine,
Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/movement.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import deques
import std/deques
import editorstatus, ui, editorview, gapbuffer, unicodeext, window, bufferstatus

template currentLineLen: int = bufStatus.buffer[windowNode.currentLine].len
Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/normalmode.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import terminal, times, strutils
import std/[terminal, times, strutils]
import editorstatus, ui, gapbuffer, unicodeext, fileutils, undoredostack,
window, movement, editor, search, bufferstatus, quickrun,
messages
Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/platform.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import osproc, strutils
import std/[osproc, strutils]

type Platforms* = enum
linux, wsl, mac, freebsd, openbsd, other
Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/quickrun.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import osproc, terminal, times
import std/[osproc, terminal, times]
import syntax/highlite
import unicodeext, settings, bufferstatus, gapbuffer, messages, ui,
editorstatus, movement, window, fileutils, commandline
Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/recentfilemode.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import os, re, terminal
import std/[os, re, terminal]
import editorstatus, ui, unicodeext, bufferstatus, movement, gapbuffer,
messages, window

Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/register.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import options, strutils, unicode
import std/[options, strutils, unicode]
import independentutils, clipboard, settings

type Register* = object
Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/replacemode.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import terminal, times, unicode
import std/[terminal, times, unicode]
import editorstatus, ui, movement, editor, bufferstatus, gapbuffer,
window, settings

Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/search.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import system, terminal, strutils
import std/[terminal, strutils]
import editorstatus, gapbuffer, commandview, movement, commandline, unicodeext

type
Expand Down
8 changes: 5 additions & 3 deletions src/moepkg/settings.nim
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import parsetoml, os, json, macros, times, options, strformat, osproc, strutils
export TomlError

import std/[os, json, macros, times, options, strformat, osproc,
strutils]
import ui, color, unicodeext, highlight, platform, independentutils
import parsetoml

export TomlError

type DebugWindowNodeSettings* = object
enable*: bool
Expand Down
4 changes: 2 additions & 2 deletions src/moepkg/statusline.nim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ui, strutils, strformat, os, osproc
import std/[strutils, strformat, os, osproc]
import syntax/highlite
import bufferstatus, color, unicodeext, settings, window, gapbuffer
import ui, bufferstatus, color, unicodeext, settings, window, gapbuffer

type StatusLine* = object
window*: Window
Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/suggestionwindow.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import critbits, sugar, options, sequtils, unicode
import std/[critbits, sugar, options, sequtils, unicode]
import ui, window, generalautocomplete, bufferstatus, gapbuffer, color,
editorstatus

Expand Down
4 changes: 2 additions & 2 deletions src/moepkg/syntax/highlite.nim
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@
##

import
strutils
from algorithm import binarySearch
std/strutils
from std/algorithm import binarySearch

type
TokenClass* = enum
Expand Down
4 changes: 2 additions & 2 deletions src/moepkg/syntax/syntaxnim.nim
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
# distribution, for details about the copyright.
#

import strutils
from algorithm import binarySearch
import std/strutils
from std/algorithm import binarySearch

import highlite

Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/tabline.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import strutils, terminal, unicode
import std/[strutils, terminal, unicode]
import ui, window, color, bufferstatus, independentutils

proc writeTab*(tabWin: var Window,
Expand Down
6 changes: 3 additions & 3 deletions src/moepkg/ui.nim
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import strformat, osproc, strutils
import std/[strformat, osproc, strutils]
when not defined unitTest:
import posix
import std/posix

from os import execShellCmd
from std/os import execShellCmd
import ncurses
import unicodeext, color

Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/undoredostack.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import sequtils, tables
import std/[sequtils, tables]

type
CommandKind = enum
Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/unicodeext.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import unicode, sequtils, strutils, strformat, os
import std/[unicode, sequtils, strutils, strformat, os]
import unicodedb/widths
import gapbuffer
export unicode
Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/visualmode.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import terminal, strutils, sequtils, times
import std/[terminal, strutils, sequtils, times]
import editorstatus, ui, gapbuffer, unicodeext, window, movement, editor,
bufferstatus, settings, register, messages, commandline

Expand Down
2 changes: 1 addition & 1 deletion src/moepkg/window.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import heapqueue, options
import std/[heapqueue, options]
import ui, editorview, gapbuffer, color, cursor, highlight, unicodeext

# vertical is default
Expand Down
2 changes: 1 addition & 1 deletion tests/tbackup.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import unittest, times, os
import std/[unittest, times, os]
import moepkg/unicodeext
include moepkg/backup

Expand Down
2 changes: 1 addition & 1 deletion tests/tclipboard.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import unittest
import std/unittest
import moepkg/[settings, unicodeext, register, clipboard]
include moepkg/[platform]

Expand Down
2 changes: 1 addition & 1 deletion tests/tcommandview.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import unittest, os, strutils
import std/[unittest, os, strutils]
import moepkg/[editorstatus, unicodeext]
include moepkg/commandview

Expand Down
2 changes: 1 addition & 1 deletion tests/tconfigmode.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import unittest, macros, strformat
import std/[unittest, macros, strformat]
import moepkg/[editorstatus, gapbuffer, bufferstatus, unicodeext]

include moepkg/configmode
Expand Down
2 changes: 1 addition & 1 deletion tests/tdebugmode.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import unittest, strformat
import std/[unittest, strformat]
import moepkg/[editorstatus, unicodeext, bufferstatus]

include moepkg/debugmode
Expand Down
2 changes: 1 addition & 1 deletion tests/teditor.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import unittest, macros
import std/[unittest, macros]
import moepkg/register
include moepkg/[editor, editorstatus, ui, platform]

Expand Down
Loading

0 comments on commit 8262e9b

Please sign in to comment.