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
Visual Block 挿入でマルチバイト文字が壊れる #600
Comments
ここだと思うんですが https://github.com/vim-jp/vim/blob/master/src/ops.c#L617 どっちにしましょうかね。
|
とりあえず
で修正してみました。 diff -r 7b2d05a51e76 src/ops.c
--- a/src/ops.c Wed Jul 23 21:10:44 2014 +0200
+++ b/src/ops.c Mon Jul 28 11:41:18 2014 +0900
@@ -609,6 +609,14 @@
}
}
+#ifdef FEAT_MBYTE
+ if (has_mbyte && spaces > 0 && (*mb_ptr2cells)(oldp) > 1)
+ {
+ spaces--;
+ count--;
+ }
+#endif
+
newp = alloc_check((unsigned)(STRLEN(oldp)) + s_len + count + 1);
if (newp == NULL)
continue; |
|
@ichizok パッチ済みででしょうか? |
そうです。 |
あーなるほど。了解です。 |
diff -r 7b2d05a51e76 src/ops.c
--- a/src/ops.c Wed Jul 23 21:10:44 2014 +0200
+++ b/src/ops.c Mon Jul 28 16:20:20 2014 +0900
@@ -609,6 +609,25 @@
}
}
+#ifdef FEAT_MBYTE
+ if (has_mbyte && spaces > 0)
+ {
+ if (b_insert)
+ {
+ int off = (*mb_head_off)(oldp, oldp + offset + spaces);
+ spaces -= off;
+ count -= off;
+ }
+ else
+ {
+ int off = (*mb_off_next)(oldp, oldp + offset);
+ offset += off;
+ spaces = 0;
+ count = 0;
+ }
+ }
+#endif
+
newp = alloc_check((unsigned)(STRLEN(oldp)) + s_len + count + 1);
if (newp == NULL)
continue; こんなのでどうでしょうか? |
よさげです。 |
なんかありそうな気もするのでしばらくランニングします。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
とりあえず登録だけ…
gg0l<C-V>jjIx<Esc>
The text was updated successfully, but these errors were encountered: