[Geany] Using Snippets

Thomas Martitz thomas.martitz at xxxxx
Thu Jan 8 23:59:47 UTC 2009


Enrico Tröger schrieb:
> Then use the snippet: class<TAB>
> and type "abcd" on the first cursor position, move the cursor back by
> two positions and press the "Move cursor in snippet" keybinding to jump
> to the next cursor position. The cursor is then inside "__construct"
> instead of inside the braces.
> Maybe we can live with that but it'd be better if it would be fixed
> though this might be not easy.
Fixed.


Thomas Martitz schrieb:
> However, the current patch is far from intelligent and nice. It's a 
> bit hackish (limited to 10 cursors, global struct in editor.c ...), 
> and the next cursor movement is apparently broken once you hit tab 
> normally between "jumps". To be investigated! Also, I changed the 
> hotkey of "go to last used tab" to nothing, so that ctrl+tab is free 
> for this (this is the best hotkey I can find for), feel free to discuss! 
Fixed, sort of. Limit is gone (it's now using a dynamically allocated 
single linked list). pressing tab between jumps should work now. Nesting 
(i.e. recursively inserting) snippets works too, so that the cursor 
positions of the old snippets are not destroyed if you insert another 
snippet.
I used my self-made single linked list implementation, since I had 
problems with GSList (with concating 2 lists and freeing in particular). 
My implementation does exactly what we need, and is yet extensible and 
reusable.

Adapting my ages old single linked dynamic list implementation to Geany 
was the most fun :)

> Yea, I thought so too (and I knew it was controversial) , but then again
> I couldn't find a better hotkey. Super is problematic I think because
> that's the Windows key on most keyboards (IIUC), and that's actually
> used by Windows and not really available for apps when running Geany on
> Windows. Maybe it's possible though.
Default hotkey issue is still open (if there even should be one).

Patch attached. This one works quite well for me.


-- 
Kind regards


--------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geany.org/pipermail/users/attachments/20090109/ea4c53e9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: snippet-v3.diff
Type: text/x-patch
Size: 18715 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/users/attachments/20090109/ea4c53e9/attachment.bin>


More information about the Users mailing list