Skip to content

Instantly share code, notes, and snippets.

--- src/main.c.orig Sat Nov 23 12:49:05 2019
+++ src/main.c Sat Nov 23 13:25:49 2019
@@ -124,7 +124,7 @@
void fixkeypad();
#endif
-#if defined(KEY_RESIZE) && !defined(__DJGPP__)
+#if defined(KEY_RESIZE) && !defined(__DJGPP__) && !defined(_WIN32)
void
sigwinch_handler(int sig, siginfo_t *info, void *unused)
==2185== Memcheck, a memory error detector
==2185== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==2185== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==2185== Command: /opt/neovim-0.5.0-bff42cd/bin/nvim -u NORC
==2185==
==2185== error calling PR_SET_PTRACER, vgdb might block
--2185-- WARNING: unhandled amd64-linux syscall: 332
--2185-- You may be able to write your own handler.
--2185-- Read the file README_MISSING_SYSCALL_OR_IOCTL.
--2185-- Nevertheless we consider this a bug. Please report
--- Makefile.orig 2017-11-04 03:26:56.000000000 +0900
+++ Makefile 2019-12-18 14:04:56.544140000 +0900
@@ -149,9 +149,9 @@
echo install -d -m 0755 $(PREFIX)/bin; \
fi
install -s -m 0755 $(PROGRAM) $(PREFIX)/bin
- @if [ ! -e $(PREFIX)/man/man1 ]; then \
- echo install -d -m 0755 $(PREFIX)/man/man1; \
- install -d -m 0755 $(PREFIX)/man/man1; \
+ @if [ ! -e $(PREFIX)/share/man/man1 ]; then \
static int encode_vim_to_nothing(
const void *const ignored,
typval_T *const tv, const char *const objname)
__attribute__((nonnull(2, 3))) __attribute__((warn_unused_result));
static int encode_vim_to_nothing(
const void *const ignored,
typval_T *const top_tv, const char *const objname)
{
const int copyID = get_copyID();
@erw7
erw7 / nc2nbc.lua
Last active November 30, 2020 10:15
Dump terminfo hashed database
if #arg < 1 then
io.stderr:write('usage: ' .. arg[0] .. " [lib] term.h\n")
os.exit(1)
end
local lib = #arg > 1 and arg[1] or 'ncurses'
local file = #arg > 1 and arg[2] or arg[1]
local ffi = require('ffi')
ffi.cdef[[
@erw7
erw7 / dein.toml
Last active January 23, 2021 06:46
Lazy loading with on_lua in dein
[ftplugin]
c = '''
if !exists('s:loaded')
" We only need to call 'setup' the first time. If neovim/nvim-lspconfig#676
" is not merged, multiple calls to 'setup' will result in multiple autocmd
" settings, multiple 'try_add' runs, and multiple client runs for nothing.
lua require'lspconfig'.clangd.setup{}
" After calling setup, autocmd will call 'try_add', so call 'try_add' only the
" first time.
lua require'lspconfig'['clangd'].manager.try_add()
--[[
Use Windows native clangd from wsl neovim.
git clone https://github.com/neovim/nvim-lspconfig ~/src/github.com/neovim/nvim-lspconfig
nvim -u init.lua
]]--
vim.o.rtp = '~/src/github.com/neovim/nvim-lspconfig,' .. vim.o.rtp
local URI_SCHEME_PATTERN = '^([a-zA-Z]+[a-zA-Z0-9+-.]*)://.*'
@erw7
erw7 / _overlapped.py.2.diff
Last active August 16, 2021 08:56
Fixed a bug in _overlapped.py in pypy3
--- _overlapped.py.orig 2021-08-16 13:38:30.403944500 +0900
+++ _overlapped.py 2021-08-16 17:53:21.577925100 +0900
@@ -272,17 +272,17 @@
if self.type != OverlappedType.TYPE_NONE:
_winapi.raise_WinError()
- self.write_buffer = bytes(bufobj)
+ self.write_buffer = _ffi.new("WSABUF[1]")
self.type = OverlappedType.TYPE_WRITE
self.handle = handle
state_enter
terminal_execute
terminal_send_key
vterm_keyboard_key
or
vterm_keyboard_unichar
terminal_fluash_output
vterm_output_read
terminal_send
term->opt.write_cb = term_write (Set by channel_terminal_open called from f_termopen)
@erw7
erw7 / ping_pong.lua
Last active September 11, 2021 15:23
Testing the use of threads from Lua in Neovim
-- When running on a thread from luajit on Windows, it terminates abnormally
-- with "Uncaught Error: attempt to call nil value" after calling on_setup().
-- If executed in the main thread, session:run() will return without blocking.
local uv = vim and vim.loop or require'luv'
local M = {}
local id = 0
function M.entry_func(id, file_or_addr, is_remote)