-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
useSkkServer = true のとき漢字変換でハングアップする (Windows) #168
Comments
原因が分かったので修正します。Linux だとハングアップはしません。エラーになります。 |
更新して試してみましたが、症状は改善していませんでした。 |
Windowsでは試していません。私の環境ではハングアップは再現しませんでしたので。 |
ちなみに、他の実装方法がないか独自に調査していましたがハングアップしたりでロクに動かないので無理でした。 |
以下の設定ファイルで動作しないことを確認しました。 local jetpackfile = vim.fn.stdpath('data') .. '/site/pack/jetpack/opt/vim-jetpack/plugin/jetpack.vim'
local jetpackurl = "https://raw.githubusercontent.com/tani/vim-jetpack/master/plugin/jetpack.vim"
if vim.fn.filereadable(jetpackfile) == 0 then
vim.fn.system(string.format('curl -fsSLo %s --create-dirs %s', jetpackfile, jetpackurl))
end
vim.cmd.source(jetpackfile)
require('jetpack.packer').startup(function(use)
use({ 'tani/vim-jetapck' })
use({ 'vim-denops/denops.vim' })
use({
'vim-skk/skkeleton',
config = function()
vim.keymap.set('i', '<C-j>', '<Plug>(skkeleton-toggle)')
vim.fn['skkeleton#config']({
useSkkServer = true
})
end
})
end) 問題が解決していないので、Issueをreopenしていただけますか? |
ちなみに、jetpack は最小構成にいらないと思います |
import * as encoding from "https://esm.sh/encoding-japanese@2.0.0/";
import { TextLineStream } from "https://deno.land/std@0.209.0/streams/mod.ts";
const Encode = {
"utf-32": "UTF32",
"utf-16": "UTF16",
"utf-16be": "UTF16BE",
"utf-16le": "UTF16LE",
"binary": "BINARY",
"ascii": "ASCII",
"jis": "JIS",
"utf-8": "UTF8",
"euc-jp": "EUCJP",
"sjis": "SJIS",
"unicode": "UNICODE",
"auto": "AUTO",
} as const;
function encode(str: string, encode: Encoding): Uint8Array {
const utf8Encoder = new TextEncoder();
const utf8Bytes = utf8Encoder.encode(str);
const eucBytesArray = encoding.convert(utf8Bytes, Encode[encode], "UTF8");
const eucBytes = Uint8Array.from(eucBytesArray);
return eucBytes;
}
async function* iterLine(
r: ReadableStream<Uint8Array>,
encoding: string,
): AsyncIterable<string> {
const lines = r
.pipeThrough(new TextDecoderStream(encoding), {
preventAbort: true,
preventCancel: true,
preventClose: true,
})
.pipeThrough(new TextLineStream());
for await (const line of lines.values({ preventCancel: true })) {
yield line as string;
}
}
const conn = await Deno.connect({
hostname: "127.0.0.1",
port: 1178,
});
const requestEncoding = "euc-jp";
const responseEncoding = "euc-jp";
if (conn) {
const word = "1ほかん ";
await conn.write(encode(word, requestEncoding));
const reader = conn.readable.getReader();
reader.releaseLock();
for await (
const str of iterLine(conn.readable, responseEncoding)
) {
console.log(str);
break;
}
conn?.write(encode("0", requestEncoding));
conn?.close();
} Please test the script.
|
@Shougo 追加で確認できたこと
|
Please test #171 |
ハングアップせず変換できました。 |
Test script 2 import * as encoding from "https://esm.sh/encoding-japanese@2.0.0/";
import { TextLineStream } from "https://deno.land/std@0.209.0/streams/mod.ts";
const Encode = {
"utf-32": "UTF32",
"utf-16": "UTF16",
"utf-16be": "UTF16BE",
"utf-16le": "UTF16LE",
"binary": "BINARY",
"ascii": "ASCII",
"jis": "JIS",
"utf-8": "UTF8",
"euc-jp": "EUCJP",
"sjis": "SJIS",
"unicode": "UNICODE",
"auto": "AUTO",
} as const;
function encode(str: string, encode: Encoding): Uint8Array {
const utf8Encoder = new TextEncoder();
const utf8Bytes = utf8Encoder.encode(str);
const eucBytesArray = encoding.convert(utf8Bytes, Encode[encode], "UTF8");
const eucBytes = Uint8Array.from(eucBytesArray);
return eucBytes;
}
async function* iterLine(
r: ReadableStream<Uint8Array>,
encoding: string,
): AsyncIterable<string> {
const lines = r
.pipeThrough(new TextDecoderStream(encoding), {
preventAbort: true,
preventCancel: true,
preventClose: true,
})
.pipeThrough(new TextLineStream());
for await (const line of lines.values({ preventCancel: true })) {
yield line as string;
}
}
const conn = await Deno.connect({
hostname: "127.0.0.1",
port: 1178,
});
const requestEncoding = "euc-jp";
const responseEncoding = "euc-jp";
if (conn) {
{
const word = "1ほかん ";
await conn.write(encode(word, requestEncoding));
const reader = conn.readable.getReader();
reader.releaseLock();
for await (
const str of iterLine(conn.readable, responseEncoding)
) {
console.log(str);
break;
}
}
{
const word = "2あい ";
await conn.write(encode(word, requestEncoding));
const reader = conn.readable.getReader();
reader.releaseLock();
for await (
const str of iterLine(conn.readable, responseEncoding)
) {
console.log(str);
break;
}
}
conn?.write(encode("0", requestEncoding));
conn?.close();
} |
2回目のところでエラーが発生します。
|
はい。おそらくこれが原因なので、修正方法を探っています |
そのままだと skkserver から候補が全くとれなくなりました。 |
修正しました。 |
@kuu この実装でよいでしょうか? |
useSkkServer = true で日本語変換しようとすると nvim がハングアップします。
(固まって何もできなくなり、タスクマネージャーで落とすしかない)
どこで問題が起こっているのかわからないのですが、調べられる範囲では下記の状況です。
OS: Windows 10
NVIM v0.9.4
deno 1.39.1
crvskkserv ver. 2.5.6 / yaskkserv2 0.1.7 (どちらの場合でも)
The text was updated successfully, but these errors were encountered: