Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#849 C mode: a block opens after #else

closed-invalid
nobody
None
5
2012-09-04
2012-04-07
No

== Steps to reproduce ==
1. position the cursor at #else|
2. press [TAB]

== Actual result ==
2.
#else
{
|
}

== Expected result ==

2. #else |

== Version ==
Name : geany
Version : 0.20
Release : 8.1.2
Architecture: x86_64
Install Date: czw, 12 sty 2012, 15:22:55
Group : Development/Tools/IDE
Size : 3991347
License : GPLv2+
Signature : RSA/SHA256, sob, 29 paź 2011, 21:43:36, Key ID b88b2fd43dbdc284
Source RPM : geany-0.20-8.1.2.src.rpm
Build Date : sob, 29 paź 2011, 21:42:16
Build Host : build12
Relocations : (not relocatable)
Packager : http://bugs.opensuse.org
Vendor : openSUSE

Discussion

  • Matthew Brush
    Matthew Brush
    2012-04-07

    Try changing the "Complete Snippet" keybinding to something other than "Tab".

     
  • Lex Trotman
    Lex Trotman
    2012-09-04

    • status: open --> closed-invalid
     
  • Lex Trotman
    Lex Trotman
    2012-09-04

    As pointed out by codebrainz, Geany is correctly completing the else snippet

     
  • Lex Trotman
    Lex Trotman
    2012-11-03

    Comment recievd from Christopher Yeleighton via sourceforge

    Geany is incorrectly completing the else snippet because \"#else\" is not \"else\". Please
    reopen.

    Reply:

    Snippets searches backward from the cursor for a contiguous sequence of wordchars and then checks if that is a snippet name. The # is not a default wordchar so it ends a word rather than being part of it.

    You can change the wordchars in snippets.conf, see the manual, but that may have other side effects if you also use snippets in other languages. So we won't change the default.

    Or change the snippet completion keybinding to something that you don't want to insert into the file as was originally suggested.