Skip to content

Instantly share code, notes, and snippets.

@k-takata
k-takata / dont-use-bmpRT.patch
Created November 23, 2017 03:17
Don't use bmpRT. Use mRT directly for DirectWrite.
diff --git a/src/gui.c b/src/gui.c
--- a/src/gui.c
+++ b/src/gui.c
@@ -2419,6 +2419,7 @@ gui_outstr_nowrap(
if (flags & GUI_MON_TRS_CURSOR)
draw_flags |= DRAW_TRANSP;
+ gui_mch_draw_string_start();
/*
* Draw the text.
@k-takata
k-takata / hg-4.3.2-cygwin-problem.diff
Created October 18, 2017 09:44
Fix that "hg log --mq" is not colored on Cygwin/MSYS2
--- /usr/lib/python2.7/site-packages/mercurial/localrepo.py.orig
+++ /usr/lib/python2.7/site-packages/mercurial/localrepo.py
@@ -366,7 +366,7 @@
setupfunc(self.ui, self.supported)
else:
self.supported = self._basesupported
- color.setup(self.ui)
+ #color.setup(self.ui)
# Add compression engines.
@k-takata
k-takata / composing_chars.txt
Created October 14, 2017 04:18
Composiong Characters
* Latin
A (U+0041): base character
Ä (U+00C4): precomposed
Ä (U+0041 0308): decomposed
* Hiragana and composing marks
か (U+304B): base character
が (U+304C): precomposed
@k-takata
k-takata / 256colors2.bat
Last active August 4, 2024 17:33
Testing ANSI color sequence on Windows 10 and other terminal emulators
@echo off
rem Based on Todd Larason's 256color2.pl.
rem Ported to Windows 10's Command Prompt.
setlocal EnableDelayedExpansion
rem display the colors
rem first the system ones:
echo System colors:
@k-takata
k-takata / rtlgetver.c
Created June 12, 2017 16:53
Check Win10 build number and detect if escape sequences can be used (without manifest)
#include <windows.h>
#include <stdio.h>
typedef BOOL (WINAPI *PfnRtlGetVersion)(LPOSVERSIONINFOW);
#define MAKE_VER(major, minor, build) \
(((major) << 24) | ((minor) << 16) | (build))
int main()
{
@echo off
echo  black 
echo  red 
echo  green 
echo  yellow 
echo  blue 
echo  magenta 
echo  cyan 
echo  while 
@k-takata
k-takata / debug.diff
Created November 29, 2016 15:51
Onigmo issue #48
diff --git a/regexec.c b/regexec.c
index e57c962..f56246a 100644
--- a/regexec.c
+++ b/regexec.c
@@ -804,6 +804,7 @@ stack_double(OnigStackType** arg_stk_base, OnigStackType** arg_stk_end,
#define STACK_POP do {\
switch (pop_level) {\
case STACK_POP_LEVEL_FREE:\
+fprintf(stderr, "STACK_POP_LEVEL_FREE\n");\
while (1) {\
@k-takata
k-takata / vimconf2016.md
Last active November 6, 2016 15:11
VimConf 2016 で発表してきた

VimConf 2016 で発表してきた

VimConf 2016 で発表をしてきましたので、その報告です。

自分の発表について

2013年から開催されているVimConfは今年で4回目となりました。今まで3回はkoronさんがトップバッターを務めていましたが、今回は私がトップバッターを務めることになりました。

9月に、10年ぶりのメジャーリリースであるVim 8.0が出たため、その新機能の紹介およびVimの歴史、Vimへの日本人の貢献について話してきました。

@k-takata
k-takata / grph3.c
Last active January 14, 2024 07:07
A sample program to draw graphics on a command prompt or a dos window
#include <windows.h>
BOOL IsWindows9x()
{
return (GetVersion() >= 0x80000000);
}
int main(int argc, char *argv[])
{
HWND hWnd;
@k-takata
k-takata / func-args.diff
Created September 15, 2016 11:31
Vim 8.0.3: spaces after a function argument cause error
diff --git a/src/userfunc.c b/src/userfunc.c
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -147,6 +147,7 @@ get_function_args(
*p = c;
}
+ p = skipwhite(p);
if (*p == ',')
++p;