@@ -45355,7 +45355,12 @@ augroup end`;
45355
45355
try {
45356
45356
let filepath = path_1.default.join(os_1.default.tmpdir(), `coc-${process.pid}.vim`);
45357
45357
await fs_2.writeFile(filepath, content);
45358
- await this.nvim.command(`source ${filepath}`);
45358
+ let cmd = `source ${filepath}`;
45359
+ const isCygwin = await this.nvim.eval('has("win32unix")');
45360
+ if (isCygwin && index_1.platform.isWindows) {
45361
+ cmd = `execute "source" . substitute(system('cygpath ${filepath.replace(/\\/g, '/')}'), '\\n', '', 'g')`;
45362
+ }
45363
+ await this.nvim.command(cmd);
45359
45364
}
45360
45365
catch (e) {
45361
45366
this.showMessage(`Can't create tmp file: ${e.message}`, 'error');
@@ -50783,12 +50788,12 @@ function getChange(oldStr, newStr, cursorEnd) {
50783
50788
newText = newStr.slice(start, nl - endOffset);
50784
50789
if (ol == nl && start == end)
50785
50790
return null;
50791
+ // optimize for add new line(s)
50786
50792
if (start == end) {
50787
50793
let pre = start == 0 ? '' : newStr[start - 1];
50788
50794
if (pre && pre != '\n'
50789
50795
&& oldStr[start] == '\n'
50790
50796
&& newText.startsWith('\n')) {
50791
- // optimize for add new line(s)
50792
50797
return { start: start + 1, end: end + 1, newText: newText.slice(1) + '\n' };
50793
50798
}
50794
50799
}
@@ -54670,7 +54675,7 @@ class Plugin extends events_1.EventEmitter {
54670
54675
return false;
54671
54676
}
54672
54677
get version() {
54673
- return workspace_1.default.version + ( true ? '-' + "6dd955143d " : undefined);
54678
+ return workspace_1.default.version + ( true ? '-' + "5b5377732d " : undefined);
54674
54679
}
54675
54680
async showInfo() {
54676
54681
if (!this.infoChannel) {
@@ -79900,7 +79905,7 @@ class ListManager {
79900
79905
}
79901
79906
else {
79902
79907
this.ui.addHighlights(highlights);
79903
- await this.ui.drawItems(items, this.name, this.listOptions.position , reload);
79908
+ await this.ui.drawItems(items, this.name, this.listOptions, reload);
79904
79909
}
79905
79910
}, null, this.disposables);
79906
79911
this.registerList(new links_1.default(nvim));
@@ -79953,7 +79958,7 @@ class ListManager {
79953
79958
this.activated = true;
79954
79959
this.window = await nvim.window;
79955
79960
this.prompt.start();
79956
- await ui.resume(name, this.listOptions.position );
79961
+ await ui.resume(name, this.listOptions);
79957
79962
}
79958
79963
async doAction(name) {
79959
79964
let { currList } = this;
@@ -83232,9 +83237,9 @@ class ListUI {
83232
83237
nvim.command(`silent! bd! ${bufnr}`, true);
83233
83238
}
83234
83239
}
83235
- async resume(name, position ) {
83240
+ async resume(name, listOptions ) {
83236
83241
let { items, selected, nvim, signOffset } = this;
83237
- await this.drawItems(items, name, position , true);
83242
+ await this.drawItems(items, name, listOptions , true);
83238
83243
if (selected.size > 0 && this.bufnr) {
83239
83244
nvim.pauseNotification();
83240
83245
for (let lnum of selected) {
@@ -83339,17 +83344,17 @@ class ListUI {
83339
83344
});
83340
83345
}
83341
83346
}
83342
- async drawItems(items, name, position = 'bottom' , reload = false) {
83347
+ async drawItems(items, name, listOptions , reload = false) {
83343
83348
let { bufnr, config, nvim } = this;
83344
- this.newTab = position == 'tab';
83349
+ this.newTab = listOptions. position == 'tab';
83345
83350
let maxHeight = config.get('maxHeight', 12);
83346
83351
let height = Math.max(1, Math.min(items.length, maxHeight));
83347
83352
let limitLines = config.get('limitLines', 30000);
83348
83353
let curr = this.items[this.index];
83349
83354
this.items = items.slice(0, limitLines);
83350
83355
if (bufnr == 0 && !this.creating) {
83351
83356
this.creating = true;
83352
- let [bufnr, winid] = await nvim.call('coc#list#create', [position, height, name]);
83357
+ let [bufnr, winid] = await nvim.call('coc#list#create', [listOptions. position, height, name, listOptions.numberSelect ]);
83353
83358
this._bufnr = bufnr;
83354
83359
this.window = nvim.createWindow(winid);
83355
83360
this.height = height;
0 commit comments