Last active
August 29, 2015 14:03
-
-
Save nocd5/e64037f53e7294528d59 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# HG changeset patch | |
# Parent b8f703a4e55fa122b5031ed077ef3eeb49e7feb6 | |
diff -r b8f703a4e55f src/ops.c | |
--- a/src/ops.c Fri Jul 04 16:43:17 2014 +0200 | |
+++ b/src/ops.c Sun Jul 06 14:35:05 2014 +0900 | |
@@ -856,6 +856,18 @@ | |
return FALSE; | |
} | |
+#if defined(FEAT_WINDOWS) && defined(FEAT_CLIPBOARD) | |
+/* | |
+ * Get block width from the clipboard | |
+ */ | |
+ static long_u get_block_width(VimClipboard *cbd) | |
+{ | |
+ long_u width = 0; | |
+ /* TODO */ | |
+ return width; | |
+} | |
+#endif | |
+ | |
/* | |
* Set y_current and y_append, according to the value of "regname". | |
* Cannot handle the '_' register. | |
@@ -870,6 +882,10 @@ | |
int writing; | |
{ | |
int i; | |
+#if defined(FEAT_WINDOWS) && defined(FEAT_CLIPBOARD) | |
+ int width; | |
+ VimClipboard *cbd; | |
+#endif | |
y_append = FALSE; | |
if ((regname == 0 || regname == '"') && !writing && y_previous != NULL) | |
@@ -892,10 +908,20 @@ | |
#ifdef FEAT_CLIPBOARD | |
/* When selection is not available, use register 0 instead of '*' */ | |
else if (clip_star.available && regname == '*') | |
+ { | |
i = STAR_REGISTER; | |
+#ifdef FEAT_WINDOWS | |
+ cbd = &clip_star; | |
+#endif | |
+ } | |
/* When clipboard is not available, use register 0 instead of '+' */ | |
else if (clip_plus.available && regname == '+') | |
+ { | |
i = PLUS_REGISTER; | |
+#ifdef FEAT_WINDOWS | |
+ cbd = &clip_plus; | |
+#endif | |
+ } | |
#endif | |
#ifdef FEAT_DND | |
else if (!writing && regname == '~') | |
@@ -904,6 +930,14 @@ | |
else /* not 0-9, a-z, A-Z or '-': use register 0 */ | |
i = 0; | |
y_current = &(y_regs[i]); | |
+#if defined(FEAT_WINDOWS) && defined(FEAT_CLIPBOARD) | |
+ if (y_current->y_type == MBLOCK && | |
+ (i == STAR_REGISTER || i == PLUS_REGISTER)) | |
+ { | |
+ width = get_block_width(cbd); | |
+ y_current->y_width = width; | |
+ } | |
+#endif | |
if (writing) /* remember the register we write into for do_put() */ | |
y_previous = y_current; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment