diff --git a/src/SelectionManager.test.ts b/src/SelectionManager.test.ts index 4de1d1cf..eb9322b6 100644 --- a/src/SelectionManager.test.ts +++ b/src/SelectionManager.test.ts @@ -143,7 +143,7 @@ describe('SelectionManager', () => { assert.equal(selectionManager.selectionText, 'foo'); }); it('should select up to non-path characters that are commonly adjacent to paths', () => { - buffer.push(stringToRow(':ab:(cd)[ef]{gh}')); + buffer.push(stringToRow(':ab:(cd)[ef]{gh}\'ij"')); selectionManager.selectWordAt([0, 0]); assert.equal(selectionManager.selectionText, ':ab'); selectionManager.selectWordAt([1, 0]); @@ -176,6 +176,14 @@ describe('SelectionManager', () => { assert.equal(selectionManager.selectionText, 'gh'); selectionManager.selectWordAt([15, 0]); assert.equal(selectionManager.selectionText, 'gh}'); + selectionManager.selectWordAt([16, 0]); + assert.equal(selectionManager.selectionText, '\'ij'); + selectionManager.selectWordAt([17, 0]); + assert.equal(selectionManager.selectionText, 'ij'); + selectionManager.selectWordAt([18, 0]); + assert.equal(selectionManager.selectionText, 'ij'); + selectionManager.selectWordAt([19, 0]); + assert.equal(selectionManager.selectionText, 'ij"'); }); }); diff --git a/src/SelectionManager.ts b/src/SelectionManager.ts index d1ccecae..b1da4926 100644 --- a/src/SelectionManager.ts +++ b/src/SelectionManager.ts @@ -41,7 +41,7 @@ const CLEAR_MOUSE_DISTANCE = 10; * A string containing all characters that are considered word separated by the * double click to select work logic. */ -const WORD_SEPARATORS = ' ()[]{}:'; +const WORD_SEPARATORS = ' ()[]{}:\'"'; // TODO: Move these constants elsewhere, they belong in a buffer or buffer // data/line class.