Skip to content

Commit

Permalink
Merge pull request #14 from SirBoonami/1.2
Browse files Browse the repository at this point in the history
1.2
  • Loading branch information
SOwOphie authored Nov 15, 2016
2 parents 43578bc + c1dc778 commit a9589ac
Show file tree
Hide file tree
Showing 40 changed files with 2,562 additions and 1,376 deletions.
7 changes: 4 additions & 3 deletions .local.wsconf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
hs: -d+0.hs
hs: -d+*WSEdit/Data.hs
hs: -d~*
*.hs
-ad 0 *.hs
-ad * WSEdit/Data.hs
-as *
62 changes: 35 additions & 27 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ The file tree looks somewhat like this:
Setup.hs
stack.yaml
WSEdit/
Arguments/
Data.hs
Parser.hs
Arguments.hs
Buffer.hs
Control/
Autocomplete.hs
Expand Down Expand Up @@ -61,33 +65,31 @@ Let's go through them one by one.

Now that we've covered all the boring boilerplate, let's get to the juicy part!

* __WSEdit.hs__: Main file, gets called first. Contains the whole
initialization process, options parsing, the main loop and runtime error
catching / disaster procedures.
* __WSEdit.hs__: Main file, gets called first. Contains the main loop and
runtime error catching / disaster procedures.

* __WSEdit/Data.hs__: Declares all data structures as well as their default
instances. Corresponds to the __Model__ part of the MVC design pattern.
* __WSEdit/Arguments.hs__: Handles all the argument processing.

* __WSEdit/Data/Algorithms.hs__: Contains some algorithms used to interface
with the structures declared in `WSEdit/Data.hs`.
* __WSEdit/Arguments/Data.hs__: Contains some data types used for argument
processing.

* __WSEdit/Data/Pretty.hs__: Declares reduced versions of some data
structures that can be `read` and `show`n as well as functions converting
between them and the real deal. Integral to the `CRASH-DUMP` mechanic.
* __WSEdit/Arguments/Parser.hs__: Evil module full of black parsec magic.

* __WSEdit/Keymaps.hs__: Declares the default keymap as a pairing of
_key combination_, _handler_ and _help text_.
* __WSEdit/Buffer.hs__: Declares the data structure used to store the edited
file in an efficient way. Loosely based on
[PointedList](http://hackage.haskell.org/package/pointedlist)s, but with
some additional features to improve efficiency for our use case.

* __WSEdit/Control.hs__: Aggregator for its sub-modules, contains no actual
code. These modules define the handler functions used mostly in
`WSEdit/Keymaps.hs`, but also in some other places, as well as some common
building blocks for handler functions. Corresponds to the __Controller__
part of the MVC design pattern.

* __WSEdit/Control/Autocomplete.hs__: Contains everything related to tab

* __WSEdit/Control/Base.hs__: Some common actions, e.g. moving the cursor,
creating an undo history entry, displaying a loading screen, ...

* __WSEdit/Control/Autocomplete.hs__: Contains everything related to tab
completion.

* __WSEdit/Control/Global.hs__: Some functions operating on a global scale,
Expand All @@ -101,6 +103,22 @@ Now that we've covered all the boring boilerplate, let's get to the juicy part!
* __WSEdit/Control/Text.hs__: Text editing stuff like inserting a
character, ...

* __WSEdit/Data.hs__: Declares all data structures as well as their default
instances. Corresponds to the __Model__ part of the MVC design pattern.

* __WSEdit/Data/Algorithms.hs__: Contains some algorithms used to interface
with the structures declared in `WSEdit/Data.hs`.

* __WSEdit/Data/Pretty.hs__: Declares reduced versions of some data
structures that can be `read` and `show`n as well as functions converting
between them and the real deal. Integral to the `CRASH-DUMP` mechanic.

* __WSEdit/Help.hs__: Contains help strings as well as some functions related
to formatting them.

* __WSEdit/Keymaps.hs__: Declares the default keymap as a pairing of
_key combination_, _handler_ and _help text_.

* __WSEdit/Output.hs__: Everything related to producing a coherent image on
the screen. Especially the main `draw` call and its subcomponents, but also
some utility functions like getting display bounds, character widths, ...
Expand All @@ -110,16 +128,8 @@ Now that we've covered all the boring boilerplate, let's get to the juicy part!
functions that rebuild the rendering caches. Since they're intended to be
called in immediate succession, only one meta-function is exported.

* __WSEdit/Help.hs__: Contains help strings as well as some functions related
to formatting them.

* __WSEdit/Util.hs__: Unsorted collection of helper functions that are not
necessarily related to `wsedit`.

* __WSEdit/Buffer.hs__: Declares the data structure used to store the edited
file in an efficient way. Loosely based on
[PointedList](http://hackage.haskell.org/package/pointedlist)s, but with
some additional features to improve efficiency for our use case.
* __WSEdit/Util.hs__: Unsorted collection of generic helper functions that
are not necessarily related to `wsedit`s data model.

* __WSEdit/WordTree.hs__: Implements the prefix tree used as the autocomplete
dictionary.
Expand Down Expand Up @@ -181,9 +191,7 @@ This process is optimized by smart recalculation as follows:
cache it writes, we can resume parsing tokens at the first changed line and
stop as soon as we hit the lower edge of the screen. Also, since the cache
is stored as a regular list in reverse order, the common tail of two steps
won't take up any additional space. (This optimization is only implemented
partially yet. Every recalculation will start from the first line for now.
The potential for optimization is there, but small for files <10000 lines.)
won't take up any additional space.

For some operations it is necessary to ignore all existing caches (e.g. changes
in search term highlighting). `EdState` contains the field `fullRebdReq :: Bool`
Expand Down
38 changes: 0 additions & 38 deletions LICENSE

This file was deleted.

61 changes: 61 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# WYVERNSCALE SOURCE CODE LICENSE v2.0

COPYRIGHT (c) 2016, Felix Hirn

This license may only be copied verbatim, not in modified form.



## 1. Terms And Definitions

* A software's __user__ is anybody permitted to make use of the software in some
way further specified by its license.

* __Source code__ is the preferred form of editing the software.

* __Free software__ is software that grants its users at least the following
rights and guarantees, revokable only if the user breaks the license
agreement:

1. The right to use the software in any way, privately or with other users.

2. The right to share the unmodified software with other users, in any form.

3. The right and unobstructed possibility to view and modify the program's
source code.

4. The right to share said modifications with other users. Individual licenses
may specify restrictions on how these modifications are to be released, as
long as the resulting conditions still satisfy the definition of free
software.

* __Functional modifications__ are modifications that alter the behaviour of the
software in a nontrivial way.



## 2. Rights Granted To Users

The licensed software is free software as described above, under the following
terms:

* Becoming a user of the software is not tied to any conditions.

* Functionally unmodified parts in any form must be distributed with this
license or any of its future versions, if explicitly allowed by the software's
author.

* Functionally modified parts may be released under any free software license,
as long as they are clearly labelled as modifications so that they cannot be
confused with the unmodified version.



## 3. Disclaimer

The licensed software is to be regarded as an awful, insecure, barely-working
hack job. It should only be used in a secured environment that prevents the
software from causing any harm, including, but not limited to damage from
unexpected side effects or refusal to run at all. Any potential damage caused
by the software is to blame on failure to implement sufficient safety measures
and therefore on the user, not on the developer of the software.
Loading

0 comments on commit a9589ac

Please sign in to comment.