range rework

This commit is contained in:
Timo 2020-12-02 15:55:19 +02:00
parent 08262981fd
commit aaba8d47ac

View File

@ -10,8 +10,6 @@ import { reference } from '../../../utils/functions';
import { debounce } from '../../../utils/debounce';
declare var ace;
ace.config.set('basePath', '/assets/ace-editor/');
const Range = ace.acequire('ace/range').Range;
@Component({
selector: 'redaction-dictionary-overview-screen',
@ -46,6 +44,7 @@ export class DictionaryOverviewScreenComponent {
private readonly _activatedRoute: ActivatedRoute,
private readonly _appStateService: AppStateService
) {
ace.config.set('basePath', '/assets/ace-editor/');
this._activatedRoute.params.subscribe((params) => {
this.dictionary = this._appStateService.dictionaryData[params.type];
if (!this.dictionary) {
@ -96,6 +95,7 @@ export class DictionaryOverviewScreenComponent {
});
this.activeSearchMarkers = [];
const Range = ace.acequire('ace/range').Range;
for (const position of this.searchPositions) {
this.activeSearchMarkers.push(
this.editorComponent
@ -133,6 +133,7 @@ export class DictionaryOverviewScreenComponent {
}
}
const Range = ace.acequire('ace/range').Range;
for (const i of this.changedLines) {
this.activeEditMarkers.push(this.editorComponent.getEditor().getSession().addMarker(new Range(i, 0, i, 1), 'changed-row-marker', 'fullLine'));
}