From e16e39ef81b8c2644d5a7ecef3d0baca28b6b024 Mon Sep 17 00:00:00 2001 From: fox0430 Date: Fri, 17 Dec 2021 02:24:11 +0900 Subject: [PATCH 1/4] Fix import --- src/moe.nim | 2 +- src/moepkg/backup.nim | 2 +- src/moepkg/bookmark.nim | 2 +- src/moepkg/buffermanager.nim | 2 +- src/moepkg/bufferstatus.nim | 2 +- src/moepkg/build.nim | 2 +- src/moepkg/clipboard.nim | 2 +- src/moepkg/cmdlineoption.nim | 2 +- src/moepkg/color.nim | 2 +- src/moepkg/commandline.nim | 2 +- src/moepkg/commandview.nim | 2 +- src/moepkg/configmode.nim | 2 +- src/moepkg/cursor.nim | 2 +- src/moepkg/debugmode.nim | 2 +- src/moepkg/diffviewer.nim | 2 +- src/moepkg/editor.nim | 2 +- src/moepkg/editorstatus.nim | 4 ++-- src/moepkg/editorview.nim | 2 +- src/moepkg/exmode.nim | 2 +- src/moepkg/filermode.nim | 10 ++++++---- src/moepkg/fileutils.nim | 2 +- src/moepkg/gapbuffer.nim | 2 +- src/moepkg/generalautocomplete.nim | 2 +- src/moepkg/help.nim | 2 +- src/moepkg/highlight.nim | 4 ++-- src/moepkg/historymanager.nim | 2 +- src/moepkg/independentutils.nim | 2 +- src/moepkg/insertmode.nim | 2 +- src/moepkg/logviewer.nim | 2 +- src/moepkg/messages.nim | 2 +- src/moepkg/movement.nim | 2 +- src/moepkg/normalmode.nim | 2 +- src/moepkg/platform.nim | 2 +- src/moepkg/quickrun.nim | 2 +- src/moepkg/recentfilemode.nim | 2 +- src/moepkg/register.nim | 2 +- src/moepkg/replacemode.nim | 2 +- src/moepkg/search.nim | 2 +- src/moepkg/settings.nim | 8 +++++--- src/moepkg/statusline.nim | 4 ++-- src/moepkg/suggestionwindow.nim | 2 +- src/moepkg/syntax/highlite.nim | 4 ++-- src/moepkg/syntax/syntaxnim.nim | 4 ++-- src/moepkg/tabline.nim | 2 +- src/moepkg/ui.nim | 6 +++--- src/moepkg/undoredostack.nim | 2 +- src/moepkg/unicodeext.nim | 2 +- src/moepkg/visualmode.nim | 2 +- src/moepkg/window.nim | 2 +- 49 files changed, 65 insertions(+), 61 deletions(-) diff --git a/src/moe.nim b/src/moe.nim index b0f681327..2c6a53ddb 100644 --- a/src/moe.nim +++ b/src/moe.nim @@ -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, diff --git a/src/moepkg/backup.nim b/src/moepkg/backup.nim index 5a6986c31..3e187c776 100644 --- a/src/moepkg/backup.nim +++ b/src/moepkg/backup.nim @@ -1,4 +1,4 @@ -import os, times, re +import std/[os, times, re] import settings, unicodeext, fileutils, bufferstatus, gapbuffer, messages, commandline diff --git a/src/moepkg/bookmark.nim b/src/moepkg/bookmark.nim index 32bcac530..348d0dc74 100644 --- a/src/moepkg/bookmark.nim +++ b/src/moepkg/bookmark.nim @@ -1,4 +1,4 @@ -import os +import std/os type Bookmark* = object path*: string diff --git a/src/moepkg/buffermanager.nim b/src/moepkg/buffermanager.nim index dae5ef2a0..385910b09 100644 --- a/src/moepkg/buffermanager.nim +++ b/src/moepkg/buffermanager.nim @@ -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 diff --git a/src/moepkg/bufferstatus.nim b/src/moepkg/bufferstatus.nim index e9f9474c5..c2387d29d 100644 --- a/src/moepkg/bufferstatus.nim +++ b/src/moepkg/bufferstatus.nim @@ -1,4 +1,4 @@ -import tables, times, options +import std/[tables, times, options] import syntax/highlite import gapbuffer, unicodeext diff --git a/src/moepkg/build.nim b/src/moepkg/build.nim index c16096d93..c997ad6b6 100644 --- a/src/moepkg/build.nim +++ b/src/moepkg/build.nim @@ -1,4 +1,4 @@ -import os, osproc, strformat, unicode +import std/[os, osproc, strformat, unicode] import syntax/highlite proc build*(filename, workspaceRoot, diff --git a/src/moepkg/clipboard.nim b/src/moepkg/clipboard.nim index 046dc8115..a8beb72cd 100644 --- a/src/moepkg/clipboard.nim +++ b/src/moepkg/clipboard.nim @@ -1,4 +1,4 @@ -import unicode, os +import std/[unicode, os] import independentutils, platform, settings proc runesToStrings(runes: seq[seq[Rune]]): string = diff --git a/src/moepkg/cmdlineoption.nim b/src/moepkg/cmdlineoption.nim index 1beeb1e98..fa7acd78f 100644 --- a/src/moepkg/cmdlineoption.nim +++ b/src/moepkg/cmdlineoption.nim @@ -1,4 +1,4 @@ -import parseopt, pegs, os, strformat +import std/[parseopt, pegs, os, strformat] type CmdParsedList* = object path*: seq[string] diff --git a/src/moepkg/color.nim b/src/moepkg/color.nim index 4e4fc4e5f..6509ccf58 100644 --- a/src/moepkg/color.nim +++ b/src/moepkg/color.nim @@ -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 = diff --git a/src/moepkg/commandline.nim b/src/moepkg/commandline.nim index 927ebace2..d863b4684 100644 --- a/src/moepkg/commandline.nim +++ b/src/moepkg/commandline.nim @@ -1,4 +1,4 @@ -import terminal +import std/terminal import ui, unicodeext, color type CommandLine* = object diff --git a/src/moepkg/commandview.nim b/src/moepkg/commandview.nim index 1a668a956..02f636321 100644 --- a/src/moepkg/commandview.nim +++ b/src/moepkg/commandview.nim @@ -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 diff --git a/src/moepkg/configmode.nim b/src/moepkg/configmode.nim index 2671fbdee..de2f99cb6 100644 --- a/src/moepkg/configmode.nim +++ b/src/moepkg/configmode.nim @@ -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 diff --git a/src/moepkg/cursor.nim b/src/moepkg/cursor.nim index 7e3485434..16779c0d4 100644 --- a/src/moepkg/cursor.nim +++ b/src/moepkg/cursor.nim @@ -1,4 +1,4 @@ -import deques, strformat +import std/[deques, strformat] import editorview, unicodeext type CursorPosition* = object diff --git a/src/moepkg/debugmode.nim b/src/moepkg/debugmode.nim index 38b7071a3..4e5b35fcc 100644 --- a/src/moepkg/debugmode.nim +++ b/src/moepkg/debugmode.nim @@ -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 diff --git a/src/moepkg/diffviewer.nim b/src/moepkg/diffviewer.nim index 88a335147..e2fc004d0 100644 --- a/src/moepkg/diffviewer.nim +++ b/src/moepkg/diffviewer.nim @@ -1,4 +1,4 @@ -import times, terminal +import std/[times, terminal] import editorstatus, unicodeext, bufferstatus, highlight, color, gapbuffer, ui, movement, window diff --git a/src/moepkg/editor.nim b/src/moepkg/editor.nim index 97bc28712..f9ac68373 100644 --- a/src/moepkg/editor.nim +++ b/src/moepkg/editor.nim @@ -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 diff --git a/src/moepkg/editorstatus.nim b/src/moepkg/editorstatus.nim index cbc7def11..e872c7a34 100644 --- a/src/moepkg/editorstatus.nim +++ b/src/moepkg/editorstatus.nim @@ -1,5 +1,5 @@ -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, diff --git a/src/moepkg/editorview.nim b/src/moepkg/editorview.nim index f33f78532..4afa8339b 100644 --- a/src/moepkg/editorview.nim +++ b/src/moepkg/editorview.nim @@ -1,4 +1,4 @@ -import deques, strutils, math, strformat +import std/[deques, strutils, math, strformat] import gapbuffer, ui, unicodeext, independentutils, color, settings, bufferstatus, highlight diff --git a/src/moepkg/exmode.nim b/src/moepkg/exmode.nim index 300691de7..ad433ab81 100644 --- a/src/moepkg/exmode.nim +++ b/src/moepkg/exmode.nim @@ -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, diff --git a/src/moepkg/filermode.nim b/src/moepkg/filermode.nim index 4e64f6564..a47e8380b 100644 --- a/src/moepkg/filermode.nim +++ b/src/moepkg/filermode.nim @@ -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, @@ -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) diff --git a/src/moepkg/fileutils.nim b/src/moepkg/fileutils.nim index 9f61a99d0..3b9f16243 100644 --- a/src/moepkg/fileutils.nim +++ b/src/moepkg/fileutils.nim @@ -1,4 +1,4 @@ -import os, encodings +import std/[os, encodings] import gapbuffer, unicodeext proc normalizePath*(path: seq[Rune]): seq[Rune] = diff --git a/src/moepkg/gapbuffer.nim b/src/moepkg/gapbuffer.nim index 16da43c1b..61f0327b8 100644 --- a/src/moepkg/gapbuffer.nim +++ b/src/moepkg/gapbuffer.nim @@ -1,4 +1,4 @@ -import macros, strformat +import std/[macros, strformat] import undoredostack export undoredostack diff --git a/src/moepkg/generalautocomplete.nim b/src/moepkg/generalautocomplete.nim index 2f8fe7b1d..5a1c66a6f 100644 --- a/src/moepkg/generalautocomplete.nim +++ b/src/moepkg/generalautocomplete.nim @@ -1,4 +1,4 @@ -import sugar, critbits, options +import std/[sugar, critbits, options] import unicodedb/properties import unicodeext, bufferstatus diff --git a/src/moepkg/help.nim b/src/moepkg/help.nim index c63b03e35..9830362c1 100644 --- a/src/moepkg/help.nim +++ b/src/moepkg/help.nim @@ -1,4 +1,4 @@ -import terminal +import std/[terminal] import editorstatus, bufferstatus, ui, movement, unicodeext, gapbuffer, window const helpsentences = """ diff --git a/src/moepkg/highlight.nim b/src/moepkg/highlight.nim index 002ff8893..ed379f052 100644 --- a/src/moepkg/highlight.nim +++ b/src/moepkg/highlight.nim @@ -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 diff --git a/src/moepkg/historymanager.nim b/src/moepkg/historymanager.nim index f13f833fa..6ebff1c82 100644 --- a/src/moepkg/historymanager.nim +++ b/src/moepkg/historymanager.nim @@ -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 diff --git a/src/moepkg/independentutils.nim b/src/moepkg/independentutils.nim index a4b79a7e2..c21112444 100644 --- a/src/moepkg/independentutils.nim +++ b/src/moepkg/independentutils.nim @@ -1,4 +1,4 @@ -import strutils, math, random, osproc +import std/[strutils, math, random, osproc] proc numberOfDigits*(x: int): int {.inline.} = x.intToStr.len diff --git a/src/moepkg/insertmode.nim b/src/moepkg/insertmode.nim index 859d9ed9c..abec6915c 100644 --- a/src/moepkg/insertmode.nim +++ b/src/moepkg/insertmode.nim @@ -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 diff --git a/src/moepkg/logviewer.nim b/src/moepkg/logviewer.nim index 83fb0c2bc..666bd7fd9 100644 --- a/src/moepkg/logviewer.nim +++ b/src/moepkg/logviewer.nim @@ -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.} = diff --git a/src/moepkg/messages.nim b/src/moepkg/messages.nim index 2ae5664b6..53b934b78 100644 --- a/src/moepkg/messages.nim +++ b/src/moepkg/messages.nim @@ -1,4 +1,4 @@ -import strformat, os, strutils +import std/[strformat, os, strutils] import color, unicodeext, settings, commandline, independentutils proc writeMessageOnCommandWindow*(commandLine: var CommandLine, diff --git a/src/moepkg/movement.nim b/src/moepkg/movement.nim index 7b2a1a65d..cac721922 100644 --- a/src/moepkg/movement.nim +++ b/src/moepkg/movement.nim @@ -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 diff --git a/src/moepkg/normalmode.nim b/src/moepkg/normalmode.nim index 68de08e0e..4e9d86463 100644 --- a/src/moepkg/normalmode.nim +++ b/src/moepkg/normalmode.nim @@ -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 diff --git a/src/moepkg/platform.nim b/src/moepkg/platform.nim index 8b2f6360f..4853ba2da 100644 --- a/src/moepkg/platform.nim +++ b/src/moepkg/platform.nim @@ -1,4 +1,4 @@ -import osproc, strutils +import std/[osproc, strutils] type Platforms* = enum linux, wsl, mac, freebsd, openbsd, other diff --git a/src/moepkg/quickrun.nim b/src/moepkg/quickrun.nim index ed2a55925..6cbf04cdf 100644 --- a/src/moepkg/quickrun.nim +++ b/src/moepkg/quickrun.nim @@ -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 diff --git a/src/moepkg/recentfilemode.nim b/src/moepkg/recentfilemode.nim index fb54fbd0f..9d8ef6732 100644 --- a/src/moepkg/recentfilemode.nim +++ b/src/moepkg/recentfilemode.nim @@ -1,4 +1,4 @@ -import os, re, terminal +import std/[os, re, terminal] import editorstatus, ui, unicodeext, bufferstatus, movement, gapbuffer, messages, window diff --git a/src/moepkg/register.nim b/src/moepkg/register.nim index f84393750..1cea957fb 100644 --- a/src/moepkg/register.nim +++ b/src/moepkg/register.nim @@ -1,4 +1,4 @@ -import options, strutils, unicode +import std/[options, strutils, unicode] import independentutils, clipboard, settings type Register* = object diff --git a/src/moepkg/replacemode.nim b/src/moepkg/replacemode.nim index 4f5494a3d..97f252fda 100644 --- a/src/moepkg/replacemode.nim +++ b/src/moepkg/replacemode.nim @@ -1,4 +1,4 @@ -import terminal, times, unicode +import std/[terminal, times, unicode] import editorstatus, ui, movement, editor, bufferstatus, gapbuffer, window, settings diff --git a/src/moepkg/search.nim b/src/moepkg/search.nim index 5db0bd6bf..37286fefe 100644 --- a/src/moepkg/search.nim +++ b/src/moepkg/search.nim @@ -1,4 +1,4 @@ -import system, terminal, strutils +import std/[terminal, strutils] import editorstatus, gapbuffer, commandview, movement, commandline, unicodeext type diff --git a/src/moepkg/settings.nim b/src/moepkg/settings.nim index d60bc8a87..a9d1f149b 100644 --- a/src/moepkg/settings.nim +++ b/src/moepkg/settings.nim @@ -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 diff --git a/src/moepkg/statusline.nim b/src/moepkg/statusline.nim index bbc68a28e..dd6807ef4 100644 --- a/src/moepkg/statusline.nim +++ b/src/moepkg/statusline.nim @@ -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 diff --git a/src/moepkg/suggestionwindow.nim b/src/moepkg/suggestionwindow.nim index d17045174..92b80dd8c 100644 --- a/src/moepkg/suggestionwindow.nim +++ b/src/moepkg/suggestionwindow.nim @@ -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 diff --git a/src/moepkg/syntax/highlite.nim b/src/moepkg/syntax/highlite.nim index 319a50c9a..7284b18d9 100644 --- a/src/moepkg/syntax/highlite.nim +++ b/src/moepkg/syntax/highlite.nim @@ -65,8 +65,8 @@ ## import - strutils -from algorithm import binarySearch + std/strutils +from std/algorithm import binarySearch type TokenClass* = enum diff --git a/src/moepkg/syntax/syntaxnim.nim b/src/moepkg/syntax/syntaxnim.nim index 466aec0dc..888368a4b 100644 --- a/src/moepkg/syntax/syntaxnim.nim +++ b/src/moepkg/syntax/syntaxnim.nim @@ -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 diff --git a/src/moepkg/tabline.nim b/src/moepkg/tabline.nim index db6fc9f34..daad5ba48 100644 --- a/src/moepkg/tabline.nim +++ b/src/moepkg/tabline.nim @@ -1,4 +1,4 @@ -import strutils, terminal, unicode +import std/[strutils, terminal, unicode] import ui, window, color, bufferstatus, independentutils proc writeTab*(tabWin: var Window, diff --git a/src/moepkg/ui.nim b/src/moepkg/ui.nim index 40ca75804..23b9a980d 100644 --- a/src/moepkg/ui.nim +++ b/src/moepkg/ui.nim @@ -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 diff --git a/src/moepkg/undoredostack.nim b/src/moepkg/undoredostack.nim index 941323898..5f63ddcde 100644 --- a/src/moepkg/undoredostack.nim +++ b/src/moepkg/undoredostack.nim @@ -1,4 +1,4 @@ -import sequtils, tables +import std/[sequtils, tables] type CommandKind = enum diff --git a/src/moepkg/unicodeext.nim b/src/moepkg/unicodeext.nim index d1f5f85f3..62b391f81 100644 --- a/src/moepkg/unicodeext.nim +++ b/src/moepkg/unicodeext.nim @@ -1,4 +1,4 @@ -import unicode, sequtils, strutils, strformat, os +import std/[unicode, sequtils, strutils, strformat, os] import unicodedb/widths import gapbuffer export unicode diff --git a/src/moepkg/visualmode.nim b/src/moepkg/visualmode.nim index f058ef74c..b8177339c 100644 --- a/src/moepkg/visualmode.nim +++ b/src/moepkg/visualmode.nim @@ -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 diff --git a/src/moepkg/window.nim b/src/moepkg/window.nim index 195490b01..66be9383a 100644 --- a/src/moepkg/window.nim +++ b/src/moepkg/window.nim @@ -1,4 +1,4 @@ -import heapqueue, options +import std/[heapqueue, options] import ui, editorview, gapbuffer, color, cursor, highlight, unicodeext # vertical is default From 602f338869e83d86d6c45a0545f98366c4fb7b07 Mon Sep 17 00:00:00 2001 From: fox0430 Date: Fri, 17 Dec 2021 02:24:30 +0900 Subject: [PATCH 2/4] Fix Nim version --- moe.nimble | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/moe.nimble b/moe.nimble index 383d15dd8..c63a43549 100644 --- a/moe.nimble +++ b/moe.nimble @@ -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" From f4acaef8d357c4f87ca32342038af5207d133b72 Mon Sep 17 00:00:00 2001 From: fox0430 Date: Fri, 17 Dec 2021 02:45:56 +0900 Subject: [PATCH 3/4] Fix import in tests --- tests/tbackup.nim | 2 +- tests/tclipboard.nim | 2 +- tests/tcommandview.nim | 2 +- tests/tconfigmode.nim | 2 +- tests/tdebugmode.nim | 2 +- tests/teditor.nim | 2 +- tests/teditorstatus.nim | 9 +++++---- tests/teditorview.nim | 2 +- tests/texmode.nim | 2 +- tests/tfilermode.nim | 2 +- tests/tgapbuffer.nim | 2 +- tests/tgeneralautocomplete.nim | 2 +- tests/thelp.nim | 2 +- tests/thighlight.nim | 2 +- tests/thighlight_private.nim | 2 +- tests/thistorymanager.nim | 2 +- tests/tinsertmode.nim | 2 +- tests/tlogviewer.nim | 2 +- tests/tmovement.nim | 2 +- tests/tnormalmode.nim | 2 +- tests/tquittest1.nim | 2 +- tests/tquittest2.nim | 2 +- tests/tquittest3.nim | 2 +- tests/tquittest4.nim | 2 +- tests/tquittest5.nim | 2 +- tests/tregister.nim | 2 +- tests/treplacemode.nim | 2 +- tests/tsearch.nim | 4 ++-- tests/tsettings.nim | 2 +- tests/tunicodeext.nim | 2 +- tests/tvisualmode.nim | 2 +- 31 files changed, 36 insertions(+), 35 deletions(-) diff --git a/tests/tbackup.nim b/tests/tbackup.nim index 2217096b7..13d3af5b3 100644 --- a/tests/tbackup.nim +++ b/tests/tbackup.nim @@ -1,4 +1,4 @@ -import unittest, times, os +import std/[unittest, times, os] import moepkg/unicodeext include moepkg/backup diff --git a/tests/tclipboard.nim b/tests/tclipboard.nim index 48944b445..e70642d94 100644 --- a/tests/tclipboard.nim +++ b/tests/tclipboard.nim @@ -1,4 +1,4 @@ -import unittest +import std/unittest import moepkg/[settings, unicodeext, register, clipboard] include moepkg/[platform] diff --git a/tests/tcommandview.nim b/tests/tcommandview.nim index ab3e485e8..34639521b 100644 --- a/tests/tcommandview.nim +++ b/tests/tcommandview.nim @@ -1,4 +1,4 @@ -import unittest, os, strutils +import std/[unittest, os, strutils] import moepkg/[editorstatus, unicodeext] include moepkg/commandview diff --git a/tests/tconfigmode.nim b/tests/tconfigmode.nim index 72c16b2e0..d2fa0b33c 100644 --- a/tests/tconfigmode.nim +++ b/tests/tconfigmode.nim @@ -1,4 +1,4 @@ -import unittest, macros, strformat +import std/[unittest, macros, strformat] import moepkg/[editorstatus, gapbuffer, bufferstatus, unicodeext] include moepkg/configmode diff --git a/tests/tdebugmode.nim b/tests/tdebugmode.nim index fa0b37676..631992e10 100644 --- a/tests/tdebugmode.nim +++ b/tests/tdebugmode.nim @@ -1,4 +1,4 @@ -import unittest, strformat +import std/[unittest, strformat] import moepkg/[editorstatus, unicodeext, bufferstatus] include moepkg/debugmode diff --git a/tests/teditor.nim b/tests/teditor.nim index 4387e7879..e8737a26a 100644 --- a/tests/teditor.nim +++ b/tests/teditor.nim @@ -1,4 +1,4 @@ -import unittest, macros +import std/[unittest, macros] import moepkg/register include moepkg/[editor, editorstatus, ui, platform] diff --git a/tests/teditorstatus.nim b/tests/teditorstatus.nim index eeacb4b26..ba63ccf90 100644 --- a/tests/teditorstatus.nim +++ b/tests/teditorstatus.nim @@ -1,7 +1,8 @@ -import unittest -import moepkg/[ui, highlight, editorview, gapbuffer, unicodeext, insertmode, - movement, editor, window, color, bufferstatus, - settings] +import std/unittest +import moepkg/[ui, highlight, editorview, gapbuffer, unicodeext, + editor, window, color, bufferstatus, settings] + +from moepkg/movement import keyDown, keyRight include moepkg/editorstatus diff --git a/tests/teditorview.nim b/tests/teditorview.nim index 724b8c3be..1790e72aa 100644 --- a/tests/teditorview.nim +++ b/tests/teditorview.nim @@ -1,4 +1,4 @@ -import unittest, deques +import std/[unittest, deques] import moepkg/[editorview, gapbuffer, unicodeext] test "initEditorView 1": diff --git a/tests/texmode.nim b/tests/texmode.nim index 2f4f1d25a..97332eea2 100644 --- a/tests/texmode.nim +++ b/tests/texmode.nim @@ -1,4 +1,4 @@ -import unittest, os +import std/[unittest, os] import moepkg/[ui, editorstatus, gapbuffer, exmode, unicodeext, bufferstatus, settings] diff --git a/tests/tfilermode.nim b/tests/tfilermode.nim index 884832cda..4a9f840fa 100644 --- a/tests/tfilermode.nim +++ b/tests/tfilermode.nim @@ -1,4 +1,4 @@ -import unittest, os, algorithm, strutils +import std/[unittest, os, algorithm, strutils] import moepkg/[filermode, editorstatus, highlight, color, bufferstatus, unicodeext, gapbuffer] diff --git a/tests/tgapbuffer.nim b/tests/tgapbuffer.nim index 0377a6cf6..dc634b3b7 100644 --- a/tests/tgapbuffer.nim +++ b/tests/tgapbuffer.nim @@ -1,4 +1,4 @@ -import unittest +import std/unittest import moepkg/gapbuffer test "empty": diff --git a/tests/tgeneralautocomplete.nim b/tests/tgeneralautocomplete.nim index fa0e41f77..8c651133c 100644 --- a/tests/tgeneralautocomplete.nim +++ b/tests/tgeneralautocomplete.nim @@ -1,4 +1,4 @@ -import unittest, sugar, sequtils +import std/[unittest, sugar, sequtils] import moepkg/unicodeext include moepkg/generalautocomplete diff --git a/tests/thelp.nim b/tests/thelp.nim index 603e55813..d5e0412bf 100644 --- a/tests/thelp.nim +++ b/tests/thelp.nim @@ -1,4 +1,4 @@ -import unittest, strutils +import std/[unittest, strutils] import moepkg/[editorstatus, gapbuffer, unicodeext, movement, window, bufferstatus] diff --git a/tests/thighlight.nim b/tests/thighlight.nim index b052d7866..7b0251b58 100644 --- a/tests/thighlight.nim +++ b/tests/thighlight.nim @@ -1,4 +1,4 @@ -import unittest, strutils +import std/[unittest, strutils] import moepkg/[highlight, color] import moepkg/syntax/highlite diff --git a/tests/thighlight_private.nim b/tests/thighlight_private.nim index e74b643f8..a27154df6 100644 --- a/tests/thighlight_private.nim +++ b/tests/thighlight_private.nim @@ -1,4 +1,4 @@ -import unittest, sequtils +import std/[unittest, sequtils] include moepkg/highlight diff --git a/tests/thistorymanager.nim b/tests/thistorymanager.nim index ce42169eb..1b19aefde 100644 --- a/tests/thistorymanager.nim +++ b/tests/thistorymanager.nim @@ -1,4 +1,4 @@ -import unittest, os +import std/[unittest, os] import moepkg/[unicodeext, settings] include moepkg/[historymanager] diff --git a/tests/tinsertmode.nim b/tests/tinsertmode.nim index 423fcb602..cf512e3fb 100644 --- a/tests/tinsertmode.nim +++ b/tests/tinsertmode.nim @@ -1,4 +1,4 @@ -import unittest, options, sequtils, sugar, random +import std/[unittest, options, sequtils, sugar, random] import moepkg/[editorstatus, gapbuffer, unicodeext, highlight, settings] include moepkg/[insertmode, suggestionwindow] diff --git a/tests/tlogviewer.nim b/tests/tlogviewer.nim index df1288c0d..92d844115 100644 --- a/tests/tlogviewer.nim +++ b/tests/tlogviewer.nim @@ -1,4 +1,4 @@ -import unittest +import std/unittest import moepkg/[editorstatus, logviewer, bufferstatus, unicodeext] suite "Log viewer": diff --git a/tests/tmovement.nim b/tests/tmovement.nim index 9df41b61b..ee8786473 100644 --- a/tests/tmovement.nim +++ b/tests/tmovement.nim @@ -1,4 +1,4 @@ -import unittest +import std/unittest import moepkg/[editorstatus, gapbuffer, unicodeext, highlight, movement, bufferstatus] diff --git a/tests/tnormalmode.nim b/tests/tnormalmode.nim index 3d858209f..d58222933 100644 --- a/tests/tnormalmode.nim +++ b/tests/tnormalmode.nim @@ -1,4 +1,4 @@ -import unittest +import std/unittest import ncurses import moepkg/[editorstatus, gapbuffer, unicodeext, editor, bufferstatus, register, settings] diff --git a/tests/tquittest1.nim b/tests/tquittest1.nim index 4f200e5bc..b1f4caa3d 100644 --- a/tests/tquittest1.nim +++ b/tests/tquittest1.nim @@ -1,4 +1,4 @@ -import unittest +import std/unittest import moepkg/[editorstatus, unicodeext, exmode] test "Quit command": diff --git a/tests/tquittest2.nim b/tests/tquittest2.nim index 7c2ea2c0f..4ad5671ac 100644 --- a/tests/tquittest2.nim +++ b/tests/tquittest2.nim @@ -1,4 +1,4 @@ -import unittest +import std/unittest import moepkg/[editorstatus, unicodeext, exmode, ui] test "Open buffer manager": diff --git a/tests/tquittest3.nim b/tests/tquittest3.nim index e7e93e824..022c21973 100644 --- a/tests/tquittest3.nim +++ b/tests/tquittest3.nim @@ -1,4 +1,4 @@ -import unittest +import std/unittest import moepkg/[editorstatus, unicodeext, exmode] test "Force quit command": diff --git a/tests/tquittest4.nim b/tests/tquittest4.nim index 1092f1536..ce6cc2d57 100644 --- a/tests/tquittest4.nim +++ b/tests/tquittest4.nim @@ -1,4 +1,4 @@ -import unittest +import std/unittest import moepkg/[editorstatus, unicodeext, exmode] test "All buffer quit command": diff --git a/tests/tquittest5.nim b/tests/tquittest5.nim index d7e800962..3e5681507 100644 --- a/tests/tquittest5.nim +++ b/tests/tquittest5.nim @@ -1,4 +1,4 @@ -import unittest +import std/unittest import moepkg/[editorstatus, unicodeext, exmode] test "All buffer force quit command": diff --git a/tests/tregister.nim b/tests/tregister.nim index 2c2f6aec5..d89fbea8e 100644 --- a/tests/tregister.nim +++ b/tests/tregister.nim @@ -1,4 +1,4 @@ -import unittest, options +import std/[unittest, options] import moepkg/[unicodeext, settings] include moepkg/[register] diff --git a/tests/treplacemode.nim b/tests/treplacemode.nim index b48de20a4..7194b04e2 100644 --- a/tests/treplacemode.nim +++ b/tests/treplacemode.nim @@ -1,4 +1,4 @@ -import unittest +import std/unittest import moepkg/[editorstatus, bufferstatus, unicodeext] include moepkg/replacemode diff --git a/tests/tsearch.nim b/tests/tsearch.nim index 328ace641..87b5f9592 100644 --- a/tests/tsearch.nim +++ b/tests/tsearch.nim @@ -1,5 +1,5 @@ -import unittest -import moepkg/[editorstatus] +import std/unittest +import moepkg/editorstatus include moepkg/search diff --git a/tests/tsettings.nim b/tests/tsettings.nim index 7be023459..fc4e26d39 100644 --- a/tests/tsettings.nim +++ b/tests/tsettings.nim @@ -1,4 +1,4 @@ -import unittest, options, strutils +import std/[unittest, options, strutils] import moepkg/[color, ui, highlight, unicodeext] include moepkg/settings diff --git a/tests/tunicodeext.nim b/tests/tunicodeext.nim index ae1a7bb8b..5aac82ec5 100644 --- a/tests/tunicodeext.nim +++ b/tests/tunicodeext.nim @@ -1,4 +1,4 @@ -import strutils, unittest, encodings, sequtils, sugar +import std/[strutils, unittest, encodings, sequtils, sugar] import moepkg/unicodeext test "width 1": diff --git a/tests/tvisualmode.nim b/tests/tvisualmode.nim index 2b67d360c..ad5ff323c 100644 --- a/tests/tvisualmode.nim +++ b/tests/tvisualmode.nim @@ -1,4 +1,4 @@ -import unittest, osproc +import std/[unittest, osproc] import moepkg/[editorstatus, gapbuffer, unicodeext, highlight, movement, bufferstatus, register] include moepkg/[visualmode, platform] From 01e96e5a8db25cea8650a7dfdb0ab8b5f8727bba Mon Sep 17 00:00:00 2001 From: fox0430 Date: Fri, 17 Dec 2021 02:49:03 +0900 Subject: [PATCH 4/4] Remove unused import --- src/moepkg/editorstatus.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/moepkg/editorstatus.nim b/src/moepkg/editorstatus.nim index e872c7a34..4953bd141 100644 --- a/src/moepkg/editorstatus.nim +++ b/src/moepkg/editorstatus.nim @@ -2,8 +2,8 @@ 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