This repository has been archived by the owner on Jul 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from PolyglotSymposium/feature/ctrl-e-ctrl-y
Implement up/down scrolling (CTRL-E, CTRL-Y, CTRL-U, CTRL-D)
- Loading branch information
Showing
58 changed files
with
1,332 additions
and
714 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
namespace Void.Core | ||
|
||
type BufferMessage = inherit Message | ||
|
||
type BufferEnvelopeMessage<'TBufferMessage when 'TBufferMessage :> BufferMessage> = | ||
{ | ||
BufferId : int | ||
Message : 'TBufferMessage | ||
} | ||
interface EnvelopeMessage<'TBufferMessage> | ||
|
||
type FileBufferProxy = { | ||
MaybeFilepath : string option | ||
Contents : string seq | ||
} | ||
|
||
[<RequireQualifiedAccess>] | ||
type BufferCommand = | ||
| MoveCursor of Motion | ||
interface CommandMessage | ||
interface BufferMessage | ||
|
||
[<RequireQualifiedAccess>] | ||
type BufferEvent = | ||
| Added of FileBufferProxy | ||
interface EventMessage | ||
interface BufferMessage | ||
|
||
type GetBufferContentsRequest = | ||
{ | ||
StartingAtLine : int<mLine> | ||
} | ||
interface RequestMessage | ||
interface BufferMessage | ||
|
||
type GetBufferContentsResponse = | ||
{ | ||
FirstLineNumber : int<mLine> | ||
RequestedContents : string seq | ||
} | ||
interface ResponseMessage<GetBufferContentsRequest> | ||
interface BufferMessage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
namespace Void.Core | ||
|
||
(* This is really for tests, and probably shouldn't be here. | ||
* However, I'm not going to extract a new assembly for this one class. | ||
* Besides, the test DLL shouldn't depend on Void.Core. | ||
* Void.Core has become unclear anyway: it really should be Void.Base and Void.Editor, | ||
* or something to that effect, and the test DLL should only depend on Void.Base. | ||
* So TODO: when there are several more things like this, create a test library. | ||
* Until then, this code isn't really hurting anybody. *) | ||
type CannedResponseRequestSender() = | ||
let mutable _requests = [] | ||
let mutable _responses = [] | ||
|
||
member x.registerResponse<'TRequest, 'TResponse when 'TRequest :> RequestMessage and 'TResponse :> ResponseMessage<'TRequest>> (response : 'TResponse) = | ||
_responses <- box response :: _responses | ||
|
||
member x.tryPickRequest<'TRequest when 'TRequest :> RequestMessage>() = | ||
let tryUnbox request = | ||
try | ||
unbox<'TRequest> request |> Some | ||
with _ -> | ||
None | ||
_requests |> List.tryPick tryUnbox | ||
|
||
member x.reset() = | ||
_requests <- [] | ||
_responses <- [] | ||
|
||
interface RequestSender with | ||
member x.makeRequest<'TRequest, 'TResponse when 'TRequest :> RequestMessage and 'TResponse :> ResponseMessage<'TRequest>> (request : 'TRequest) = | ||
let tryUnbox response = | ||
try | ||
unbox<'TResponse> response |> Some | ||
with _ -> | ||
None | ||
_requests <- box request :: _requests | ||
_responses |> List.tryPick tryUnbox | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.