Skip to content

Commit

Permalink
use denops-router v0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kyoh86 committed Dec 30, 2024
1 parent eabae6e commit 2d4a37d
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion denops/docbase/handler/groups_list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
type Buffer,
isBufferOpener,
type Router,
} from "jsr:@kyoh86/denops-router@~0.3.0";
} from "jsr:@kyoh86/denops-router@~0.4.0";

export async function loadGroupsList(
denops: Denops,
Expand Down
2 changes: 1 addition & 1 deletion denops/docbase/handler/new_post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type { CreatePostParams } from "../types.ts";
import { Client } from "../api/client.ts";
import { Filetype } from "./filetype.ts";
import { parsePostBufferLines, saveGroupsIntoPostBuffer } from "./post.ts";
import type { Buffer, Router } from "jsr:@kyoh86/denops-router@~0.3.0";
import type { Buffer, Router } from "jsr:@kyoh86/denops-router@~0.4.0";
import type { StateMan } from "../state.ts";
import { getbufline } from "jsr:@denops/std@~7.4.0/function";

Expand Down
2 changes: 1 addition & 1 deletion denops/docbase/handler/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { Filetype } from "./filetype.ts";
import type { Post as PostData, UpdatePostParams } from "../types.ts";
import { isGroupSummary } from "../types.ts";
import { Client } from "../api/client.ts";
import type { Buffer } from "jsr:@kyoh86/denops-router@~0.3.0";
import type { Buffer } from "jsr:@kyoh86/denops-router@~0.4.0";
import type { StateMan } from "../state.ts";
import { getCacheFile } from "../cache.ts";

Expand Down
2 changes: 1 addition & 1 deletion denops/docbase/handler/posts_list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
type Buffer,
isBufferOpener,
type Router,
} from "jsr:@kyoh86/denops-router@~0.3.0";
} from "jsr:@kyoh86/denops-router@~0.4.0";

export async function loadPostsList(
denops: Denops,
Expand Down
2 changes: 1 addition & 1 deletion denops/docbase/handler/teams_list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
type Buffer,
isBufferOpener,
type Router,
} from "jsr:@kyoh86/denops-router@~0.3.0";
} from "jsr:@kyoh86/denops-router@~0.4.0";
import { Filetype } from "./filetype.ts";
import type { StateMan } from "../state.ts";

Expand Down
26 changes: 13 additions & 13 deletions denops/docbase/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {

import { isSearchPostsParams } from "./types.ts";
import { Client } from "./api/client.ts";
import { Router } from "jsr:@kyoh86/denops-router@~0.3.0";
import { Router } from "jsr:@kyoh86/denops-router@~0.4.0";
import { XDGStateMan } from "./state.ts";

import { loadTeamsList, openPostsList } from "./handler/teams_list.ts";
Expand Down Expand Up @@ -59,39 +59,39 @@ export async function main(denops: Denops) {
});

const router = new Router("docbase");
router.handle("teams-list", {
load: (buf) => loadTeamsList(denops, stateMan, buf),
router.addHandler("teams-list", {
load: (_ctx, buf) => loadTeamsList(denops, stateMan, buf),
actions: {
open: (_, params) => openPostsList(denops, router, params),
},
});

router.handle("posts-list", {
load: (buf) => loadPostsList(denops, stateMan, buf),
router.addHandler("posts-list", {
load: (_ctx, buf) => loadPostsList(denops, stateMan, buf),
actions: {
open: (_, params) => openPost(denops, router, params),
next: (buf, _) => nextPostsList(denops, router, buf),
prev: (buf, _) => prevPostsList(denops, router, buf),
},
});

router.handle("groups-list", {
load: (buf) => loadGroupsList(denops, stateMan, buf),
router.addHandler("groups-list", {
load: (_ctx, buf) => loadGroupsList(denops, stateMan, buf),
actions: {
open: (_, params) => openGroup(denops, router, params),
next: (buf, _) => nextGroupsList(denops, router, buf),
prev: (buf, _) => prevGroupsList(denops, router, buf),
},
});

router.handle("post", {
load: (buf) => loadPost(denops, stateMan, buf),
save: (buf) => savePost(denops, stateMan, buf),
router.addHandler("post", {
load: (_ctx, buf) => loadPost(denops, stateMan, buf),
save: (_ctx, buf) => savePost(denops, stateMan, buf),
});

router.handle("new-post", {
load: (buf) => loadNewPost(denops, stateMan, buf),
save: (buf) => saveNewPost(denops, stateMan, router, buf),
router.addHandler("new-post", {
load: (_ctx, buf) => loadNewPost(denops, stateMan, buf),
save: (_ctx, buf) => saveNewPost(denops, stateMan, router, buf),
});

denops.dispatcher = await router.dispatch(denops, {
Expand Down

0 comments on commit 2d4a37d

Please sign in to comment.