mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Also consider ' and " word separators
For example URIs in json
This commit is contained in:
@@ -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"');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user