From 6075498c24175dc0d532abd95fc5d936811ce7c1 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Fri, 9 Jun 2017 12:47:16 -0700 Subject: [PATCH] Add class header comments --- src/SelectionManager.ts | 8 ++++++++ src/SelectionModel.ts | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/src/SelectionManager.ts b/src/SelectionManager.ts index cc7a2303..906d5b01 100644 --- a/src/SelectionManager.ts +++ b/src/SelectionManager.ts @@ -45,6 +45,14 @@ const LINE_DATA_WIDTH_INDEX = 2; const NON_BREAKING_SPACE_CHAR = String.fromCharCode(160); const ALL_NON_BREAKING_SPACE_REGEX = new RegExp(NON_BREAKING_SPACE_CHAR, 'g'); +/** + * A class that manages the selection of the terminal. With help from + * SelectionModel, SelectionManager handles with all logic associated with + * dealing with the selection, including handling mouse interaction, wide + * characters and fetching the actual text within the selection. Rendering is + * not handled by the SelectionManager but a 'refresh' event is fired when the + * selection is ready to be redrawn. + */ export class SelectionManager extends EventEmitter { protected _model: SelectionModel; diff --git a/src/SelectionModel.ts b/src/SelectionModel.ts index 57eb51d4..403f42e0 100644 --- a/src/SelectionModel.ts +++ b/src/SelectionModel.ts @@ -4,6 +4,10 @@ import { ITerminal } from './Interfaces'; +/** + * Represents a selection within the buffer. This model only cares about column + * and row coordinates, not wide characters. + */ export class SelectionModel { /** * Whether select all is currently active.