nimf 과 zim 사용하기

Thu, Sep 9 2021 23:50:05

Zim 0.73.5 이라는 편집기가 있습니다. 그런데 이 어플에는 입력 버그가 있습니다.

  • 한글을 입력하다가 Home 키를 누르면 zim 이 죽는 버그가 있습니다.

버그 발생 지점은 zim/gui/pageview.py#L3787 입니다. def _do_key_press_event_default 함수 안의 buffer.place_cursor(iter) 에서 zim 이 죽는 버그가 발생합니다.

$ zim --debug

...(생략)...

(zim:58280): Gtk-WARNING **: 23:07:25.334: Invalid text buffer iterator: either
the iterator is uninitialized, or the characters/pixbufs/widgets in the buffer h
ave been modified since the iterator was created.
You must use marks, character numbers, or line numbers to preserve a position ac
ross buffer modifications.
You can apply tags and insert marks without invalidating your iterators,
but any mutation that affects 'indexable' buffer contents (contents that can be
referred to by character offset)
will invalidate all outstanding iterators
Segmentation fault (core dumped)

이 버그는 zim 이 gtk text buffer iterator 를 잘못 다루어 발생하는 버그입니다.

zim 의 입력 버그를 회피하기 위해서는 님프를 설치하신 후 nimf-settings 를 실행하셔서 키 이벤트 후킹하기(Hook key events)라는 옵션을 켜셔야 됩니다.
hook-key-events.png

어떠한 환경(예를 들면 GTK4)에서는 위 옵션을 켜도 zim 이 죽는 버그가 회피되지 않을 수 있습니다. 그러한 경우에는 ‘끝글자 버그를 방지합니다’라는 옵션을 켜시고 사용하시면 되겠습니다. 감사합니다.
prevent-last-character-bugs.png