Skip to content

Instantly share code, notes, and snippets.

@splinterofchaos
splinterofchaos / log
Created August 30, 2014 04:54
neovim log on segfault
2014/08/30 00:51:15 [debug @ requeue_deferred_events:209] 7437 - Number of deferred events: 0
2014/08/30 00:51:15 [debug @ requeue_deferred_events:219] 7437 - Number of deferred events: 0
2014/08/30 00:51:15 [debug @ process_from:185] 7437 - Processed 0 events
2014/08/30 00:51:15 [debug @ loop:237] 7437 - Enter event loop
2014/08/30 00:51:15 [debug @ read_cb:271] 7437 - Received 1 bytes from RStream(address: 0x277dc10, source: 0x277dc10)
2014/08/30 00:51:15 [debug @ loop:239] 7437 - Exit event loop
2014/08/30 00:51:15 [debug @ process_from:185] 7437 - Processed 0 events
2014/08/30 00:51:15 [debug @ requeue_deferred_events:209] 7437 - Number of deferred events: 1
2014/08/30 00:51:15 [debug @ requeue_deferred_events:216] 7437 - Re-queueing event
2014/08/30 00:51:15 [debug @ requeue_deferred_events:219] 7437 - Number of deferred events: 1
@splinterofchaos
splinterofchaos / Makefile
Created October 6, 2014 21:13
Uv stdout and stderr
a.out : err.c
gcc err.c
let s:buf = 0 " The buffer we use to write/send data.
let s:job = 0 " The job that runs the commands.
let s:inbuf = '' " Data pending, sending to s:job.
command! Proc call s:new()
command! -nargs=* ProcDoLine call s:do_cmd(<f-args>)
command! ProcStop call jobstop(s:job)
command! ProcPressEnter call s:on_enter()
==18492== Memcheck, a memory error detector
==18492== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==18492== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info
==18492== Command: nvim
==18492== Parent PID: 21288
==18492==
==18492== Invalid read of size 4
==18492== at 0x4B2ED1: copy_tv (eval.c:16794)
==18492== by 0x4B15BE: get_var_tv (eval.c:15965)
==18492== by 0x499294: eval7 (eval.c:4114)
@splinterofchaos
splinterofchaos / Py.h
Last active August 29, 2015 14:10
Python API in C++
#ifndef PY_H
#define PY_H
#include <Python.h>
#include <type_traits>
#include <utility>
#include <string>
template<typename R, typename...X>
@splinterofchaos
splinterofchaos / proj.cpp
Created February 17, 2015 18:35
Projection
#include <algorithm>
#include <cassert>
#include <functional>
#include <iostream>
#include <vector>
#include <fu/fu.h>
struct Person {
@splinterofchaos
splinterofchaos / term-test.vim
Created April 6, 2015 20:26
nvim invalid read
let s:buf = -1
function! s:exit_handler()
execute 'bdelete!' s:buf
endfunction
function! s:test()
vnew
let s:buf = bufnr('%')
let id = termopen('sleep 1', { 'on_exit': function('s:exit_handler') })
@splinterofchaos
splinterofchaos / nasync.vim
Last active August 29, 2015 14:18
A small script for running asynchronous nvim commands.
" From an embedded instance, evaluates an expression and sends the result back
" to the parent instance to be executed by a callback.
function! nasync#up(expr, callback)
call rpcnotify(1, 'vim_eval', a:callback . '(' . string(eval(a:expr)) . ')')
endfunction
function! s:arg_str(...)
return join(map(copy(a:000), "string(v:val)"), ',')
endfunction
SCRIPT /usr/local/share/nvim/runtime/syntax/syncolor.vim
Sourced 1 time
Total time: 0.001307
Self time: 0.001307
count total (s) self (s)
" Vim syntax support file
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2001 Sep 12
struct Seq {
size_t start, size;
};
ostream& operator<<(ostream& os, const Seq& s) {
return os << "[" << s.start << ", " << s.size << ")";
}
// Returns the number of replacements or additions required to break sequences to have no triplets.