Skip to content

Instantly share code, notes, and snippets.

View jaap-karssenberg's full-sized avatar

Jaap Karssenberg jaap-karssenberg

View GitHub Profile
diff --git a/tests/widgets.py b/tests/widgets.py
index 36dffffd..6b88850e 100644
--- a/tests/widgets.py
+++ b/tests/widgets.py
@@ -12,11 +12,25 @@ from zim.newfs.mock import os_native_path
class TestFunctions(tests.TestCase):
- def runTest(self):
+ def testEncodeDecode(self):
diff --git a/zim/gui/pageview.py b/zim/gui/pageview.py
index be935f46..da27803c 100644
--- a/zim/gui/pageview.py
+++ b/zim/gui/pageview.py
@@ -2102,7 +2102,6 @@ class TextBuffer(Gtk.TextBuffer):
#
# Note that 'start' and 'end' refer to the same postion here ...
- offset = start.get_offset()
if (
@jaap-karssenberg
jaap-karssenberg / textview_allocation_hack.patch
Created April 9, 2019 19:13
textview_allocation_hack.patch
diff --git a/zim/gui/insertedobjects.py b/zim/gui/insertedobjects.py
index 0d2dbb6d..f15e04c4 100644
--- a/zim/gui/insertedobjects.py
+++ b/zim/gui/insertedobjects.py
@@ -80,15 +80,8 @@ class InsertedObjectWidget(Gtk.EventBox):
window.set_cursor(Gdk.Cursor.new(Gdk.CursorType.ARROW))
def set_textview_wrap_width(self, width):
- if not self.expand:
- return
#!/usr/bin/env python
#
# This sample program should be executed like so:
#
# python treetest.py ~/some/path/*
#
# And it will display the files in the treeview.
#
from __future__ import print_function
#!/usr/bin/env python
#
# This sample program should be executed like so:
#
# python treetest.py ~/some/path/*
#
# And it will display the files in the treeview.
#
from __future__ import print_function
@jaap-karssenberg
jaap-karssenberg / test_ctypes_clipboard.py
Last active April 25, 2020 15:53
Attempt to get clipboard "set_with_data()" to work using ctypes
import ctypes
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('GIRepository', '2.0')
from gi.repository import GIRepository
from gi.repository import Gtk
@jaap-karssenberg
jaap-karssenberg / archive.py
Last active May 18, 2017 12:15
Archive plugin for zim desktop wiki
# -*- coding: utf-8 -*-
# Copyright 2015 Jaap Karssenberg <jaap.karssenberg@gmail.com>
# TODO - "copy to archive" next to "move to archive"
# TODO - hook into search dialog - hide archive + show button with "show X archived pages"
# TODO - hook into auto-completion - put archive lower in the list
# To install this plugin:
# 1. in zim go to the preferences dialog, plugins tab