[Geany] Using Snippets

Thomas Martitz thomas47 at xxxxx
Sun Jan 4 18:51:07 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.
>   
Yea, it's not too intelligent :) But I personally could live with that. 
And indeed, as that'd require keeping track of cursor movement, it would 
probably not be very easy.
>> 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!
>>     
>
> This was actually not so good and so I reverted in the attached patch.
> The keybinding for "Go to last used tab" should be left unchanged, and
> there is currently no default for the new keybinding. I personally used
> Super-Tab which seems quite handy but not sure whether it should be the
> default as I have no idea how many people actually have a Super key.
>   
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.

Maybe it could also be tab as well, so that just a check for remaining 
cursor jumps would be inserted after the check for snippets. It's 
already used for indention AND snippets, maybe it could be used for that 
too.

But hey, I didn't mean to replace the hotkey for "Go to last tab", i.e. 
if my patch was complete, it wouldn't have used it, but that way I could 
get the best feedback on a proper hotkey ;)
> I also fixed a little bug where the cursor wasn't set correctly for
> snippets like:
>
> cur=%cursor%%brace_open%\n%brace_close%
>
> The cursor should be before the braces but it was placed after.
>
>
> Regards,
> Enrico
Thanks for that. And thanks for the feedback!



More information about the Users mailing list