Skip to content

Commit d6caba9

Browse files
authored
use args.context.input instead of getline() (#10)
* fix: use args.context.input instead of getline() resolves #9 * chore: update deno deps
1 parent 3cdb227 commit d6caba9

File tree

5 files changed

+16
-14
lines changed

5 files changed

+16
-14
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- os: ubuntu-latest
3838
deno: v1.x
3939
- os: ubuntu-latest
40-
deno: v1.13
40+
deno: v1.14
4141
- os: ubuntu-latest
4242
deno: v1.14
4343
- os: ubuntu-latest

autoload/ddc_file/internal.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ function! s:full_to_base_prefix(full, is_posix) abort
1616
\ ), 1, '')
1717
endfunction
1818

19+
" @param {string} input_line
1920
" @param {boolean} is_posix
2021
" @return {[
2122
" string,
2223
" string,
2324
" string,
2425
" ]}
25-
function! ddc_file#internal#info(is_posix) abort
26-
let input_line = getline('.')[: col('.') - 2]
27-
let input_file_full = s:line_to_file_full(input_line, a:is_posix)
26+
function! ddc_file#internal#info(input_line, is_posix) abort
27+
let input_file_full = s:line_to_file_full(a:input_line, a:is_posix)
2828
let input_file_base_prefix = s:full_to_base_prefix(input_file_full, a:is_posix)
2929
let buf_path = expand('%:p')
3030
return [

denops/@ddc-file/deps.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
export type {
22
Candidate,
33
Context,
4-
} from "https://deno.land/x/ddc_vim@v0.14.0/types.ts";
5-
export { BaseSource } from "https://deno.land/x/ddc_vim@v0.14.0/types.ts";
6-
export type { Denops } from "https://deno.land/x/ddc_vim@v0.14.0/deps.ts";
7-
export { fn, vars } from "https://deno.land/x/ddc_vim@v0.14.0/deps.ts";
4+
} from "https://deno.land/x/ddc_vim@v0.17.0/types.ts";
5+
export { BaseSource } from "https://deno.land/x/ddc_vim@v0.17.0/types.ts";
6+
export type { Denops } from "https://deno.land/x/ddc_vim@v0.17.0/deps.ts";
7+
export { fn, vars } from "https://deno.land/x/ddc_vim@v0.17.0/deps.ts";
88
export type {
99
GatherCandidatesArguments,
10-
} from "https://deno.land/x/ddc_vim@v0.14.0/base/source.ts";
11-
export * as path from "https://deno.land/std@0.108.0/path/mod.ts";
12-
export * as io from "https://deno.land/std@0.108.0/io/mod.ts";
13-
export * as fs from "https://deno.land/std@0.108.0/fs/mod.ts";
14-
export * as asserts from "https://deno.land/std@0.108.0/testing/asserts.ts";
10+
} from "https://deno.land/x/ddc_vim@v0.17.0/base/source.ts";
11+
export * as path from "https://deno.land/std@0.111.0/path/mod.ts";
12+
export * as io from "https://deno.land/std@0.111.0/io/mod.ts";
13+
export * as fs from "https://deno.land/std@0.111.0/fs/mod.ts";
14+
export * as asserts from "https://deno.land/std@0.111.0/testing/asserts.ts";
1515
export {
1616
asyncIteratorFrom as fromA,
1717
iteratorFrom as from,

denops/@ddc-file/internal_autoload_fn.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const createCaller = (name: string): any => {
1111

1212
export type Info = (
1313
denops: Denops,
14+
inputLine: string,
1415
isPosix: boolean,
1516
) => Promise<[
1617
string,

denops/@ddc-sources/file.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export class Source extends BaseSource<Params> {
5555
async gatherCandidates(
5656
args: GatherCandidatesArguments<Params>,
5757
): Promise<Candidate[]> {
58-
const p = args.sourceParams as Params;
58+
const p = args.sourceParams;
5959
const mode = p.mode === "os"
6060
? (Deno.build.os === "windows" ? "win32" : "posix")
6161
: p.mode;
@@ -79,6 +79,7 @@ export class Source extends BaseSource<Params> {
7979
// )
8080
const [inputFileFull, inputFileBasePrefix, bufPath] = await internal.info(
8181
args.denops,
82+
args.context.input,
8283
mode === "posix",
8384
);
8485

0 commit comments

Comments
 (0)