change to v11, expose unicodeVersion, fix linkifier
This commit is contained in:
@@ -9,12 +9,12 @@ import { IBufferLine } from 'common/Types';
|
||||
import { Linkifier } from 'browser/Linkifier';
|
||||
import { BufferLine } from 'common/buffer/BufferLine';
|
||||
import { CellData } from 'common/buffer/CellData';
|
||||
import { MockLogService, MockBufferService } from 'common/TestUtils.test';
|
||||
import { MockLogService, MockBufferService, MockOptionsService } from 'common/TestUtils.test';
|
||||
import { IBufferService } from 'common/services/Services';
|
||||
|
||||
class TestLinkifier extends Linkifier {
|
||||
constructor(bufferService: IBufferService) {
|
||||
super(bufferService, new MockLogService());
|
||||
super(bufferService, new MockLogService(), new MockOptionsService());
|
||||
Linkifier._timeBeforeLatency = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
|
||||
import { ILinkifierEvent, ILinkMatcher, LinkMatcherHandler, ILinkMatcherOptions, ILinkifier, IMouseZoneManager, IMouseZone, IRegisteredLinkMatcher } from 'browser/Types';
|
||||
import { IBufferStringIteratorResult } from 'common/buffer/Types';
|
||||
import { getStringCellWidthV6 } from 'common/CharWidth';
|
||||
import { getStringCellWidthV6, getStringCellWidthV11 } from 'common/CharWidth';
|
||||
import { EventEmitter, IEvent } from 'common/EventEmitter';
|
||||
import { ILogService, IBufferService } from 'common/services/Services';
|
||||
import { ILogService, IBufferService, IOptionsService } from 'common/services/Services';
|
||||
|
||||
/**
|
||||
* Limit of the unwrapping line expansion (overscan) at the top and bottom
|
||||
@@ -45,7 +45,8 @@ export class Linkifier implements ILinkifier {
|
||||
|
||||
constructor(
|
||||
protected readonly _bufferService: IBufferService,
|
||||
private readonly _logService: ILogService
|
||||
private readonly _logService: ILogService,
|
||||
private readonly _optionsService: IOptionsService
|
||||
) {
|
||||
this._rowsToLinkify = {
|
||||
start: undefined,
|
||||
@@ -277,8 +278,7 @@ export class Linkifier implements ILinkifier {
|
||||
if (!this._mouseZoneManager || !this._element) {
|
||||
return;
|
||||
}
|
||||
|
||||
const width = getStringCellWidthV6(uri); // FIXME: apply options.unicodeVersion
|
||||
const width = this._optionsService.options.unicodeVersion === '11' ? getStringCellWidthV11(uri) : getStringCellWidthV6(uri);
|
||||
const x1 = x % this._bufferService.cols;
|
||||
const y1 = y + Math.floor(x / this._bufferService.cols);
|
||||
let x2 = (x1 + width) % this._bufferService.cols;
|
||||
|
||||
Reference in New Issue
Block a user