diff --git a/examples/editor.nim b/examples/editor.nim index b28cf94..4b0cbff 100644 --- a/examples/editor.nim +++ b/examples/editor.nim @@ -1,10 +1,10 @@ -import ../plugin/defaults -import ../editor -import ../strutils -import ../templates -import ../multiline +import jale/plugin/defaults +import jale/editor +import jale/templates +import jale/multiline import terminal +import strutils import os eraseScreen() diff --git a/examples/interactive_basic.nim b/examples/interactive_basic.nim index 7c45664..32dfd8a 100644 --- a/examples/interactive_basic.nim +++ b/examples/interactive_basic.nim @@ -1,7 +1,8 @@ -import ../plugin/defaults -import ../editor -import ../strutils -import ../templates +import jale/plugin/defaults +import jale/editor +import jale/templates + +import strutils var keep = true diff --git a/examples/interactive_history.nim b/examples/interactive_history.nim index c4ab374..89a7097 100644 --- a/examples/interactive_history.nim +++ b/examples/interactive_history.nim @@ -1,9 +1,10 @@ -import ../plugin/defaults -import ../plugin/history -import ../plugin/editor_history -import ../editor -import ../strutils -import ../templates +import jale/plugin/defaults +import jale/plugin/history +import jale/plugin/editor_history +import jale/editor +import jale/templates + +import strutils var keep = true diff --git a/jale.nimble b/jale.nimble new file mode 100644 index 0000000..17a07dc --- /dev/null +++ b/jale.nimble @@ -0,0 +1,11 @@ +# Package + +version = "0.1.0" +author = "Productive2" +description = "Just Another Line Editor" +license = "MIT" +srcDir = "src" + +# Dependencies + +requires "nim >= 1.4.2" diff --git a/editor.nim b/src/jale/editor.nim similarity index 97% rename from editor.nim rename to src/jale/editor.nim index 1773775..5f6dadf 100644 --- a/editor.nim +++ b/src/jale/editor.nim @@ -153,5 +153,6 @@ proc read*(editor: LineEditor): string = # move cursor to end editor.moveCursorToEnd() - result = editor.content.getContent() + if editor.state == esFinishing: + result = editor.content.getContent() editor.reset() diff --git a/event.nim b/src/jale/event.nim similarity index 100% rename from event.nim rename to src/jale/event.nim diff --git a/keycodes.nim b/src/jale/keycodes.nim similarity index 100% rename from keycodes.nim rename to src/jale/keycodes.nim diff --git a/line.nim b/src/jale/line.nim similarity index 100% rename from line.nim rename to src/jale/line.nim diff --git a/multiline.nim b/src/jale/multiline.nim similarity index 100% rename from multiline.nim rename to src/jale/multiline.nim diff --git a/plugin/defaults.nim b/src/jale/plugin/defaults.nim similarity index 100% rename from plugin/defaults.nim rename to src/jale/plugin/defaults.nim diff --git a/plugin/editor_history.nim b/src/jale/plugin/editor_history.nim similarity index 100% rename from plugin/editor_history.nim rename to src/jale/plugin/editor_history.nim diff --git a/plugin/history.nim b/src/jale/plugin/history.nim similarity index 100% rename from plugin/history.nim rename to src/jale/plugin/history.nim diff --git a/renderer.nim b/src/jale/renderer.nim similarity index 100% rename from renderer.nim rename to src/jale/renderer.nim diff --git a/templates.nim b/src/jale/templates.nim similarity index 100% rename from templates.nim rename to src/jale/templates.nim diff --git a/tests/config.nims b/tests/config.nims new file mode 100644 index 0000000..3bb69f8 --- /dev/null +++ b/tests/config.nims @@ -0,0 +1 @@ +switch("path", "$projectDir/../src") \ No newline at end of file diff --git a/tests/test1.nim b/tests/test1.nim new file mode 100644 index 0000000..cc350cc --- /dev/null +++ b/tests/test1.nim @@ -0,0 +1,11 @@ +# This is just an example to get you started. You may wish to put all of your +# tests into a single file, or separate them into multiple `test1`, `test2` +# etc. files (better names are recommended, just make sure the name starts with +# the letter 't'). +# +# To run these tests, simply execute `nimble test`. + +import unittest + +test "can test": + check true