From: SourceForge.net <no...@so...> - 2009-09-29 06:14:15
|
Patches item #2023939, was opened at 2008-07-22 00:02 Message generated for change (Comment added) made by shlomy You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=300588&aid=2023939&group_id=588 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: texteditor Group: None Status: Closed Resolution: Rejected Priority: 5 Private: No Submitted By: Matthew Gilbert (voxmea) Assigned to: Kazutoshi Satoda (k_satoda) Summary: Adds special handling to the C syntax for "#if 0" Initial Comment: Comments-out all code between #if 0 and #endif. ---------------------------------------------------------------------- >Comment By: Shlomy Reinstein (shlomy) Date: 2009-09-29 08:14 Message: The Configurable Fold Handler can definitely turn them into folds, I use it all the time. I use the following regexp as fold-start string: \{|^\s*#\s*if|/\* and the following regexp as fold-end string: \}|^\s*#\s*end|\*/ Hope this is helpful. ---------------------------------------------------------------------- Comment By: Alan Ezust (ezust) Date: 2009-09-28 21:58 Message: I wonder if it is possible to make the Configurable Fold Handler turn those conditional #ifdefs into folds... ---------------------------------------------------------------------- Comment By: Kazutoshi Satoda (k_satoda) Date: 2008-08-19 16:51 Message: Logged In: YES user_id=1483238 Originator: NO > Can syntax changes be made by a plugin? It depends on what change you want. Please ask on jedit-devel or post a feature request if you have concrete idea. (Note that trackers are not good to make Q&A or discussion.) ---------------------------------------------------------------------- Comment By: Matthew Gilbert (voxmea) Date: 2008-08-13 23:29 Message: Logged In: YES user_id=2017932 Originator: YES Ah, I didn't consider nested endifs. Yeah, this won't work. Thanks for the help with HASH_CHAR. Can syntax changes be made by a plugin? ---------------------------------------------------------------------- Comment By: Kazutoshi Satoda (k_satoda) Date: 2008-08-13 22:15 Message: Logged In: YES user_id=1483238 Originator: NO Sorry, I meant to write "I don't think it is good ...". ---------------------------------------------------------------------- Comment By: Kazutoshi Satoda (k_satoda) Date: 2008-08-13 22:11 Message: Logged In: YES user_id=1483238 Originator: NO Thank you for the patch. But the evaluation is Rejected. Following is the reason. I don't think it is not good to support only "#if 0" because it gives false impression that jEdit is evaluating the CPP conditions. Without clear and strong motivation to do that, it won't be accepted. And also this patch has some technical problems. First problem is HASH_CHAR="#if 0". This rejects anything but "#if 0" literally, for example, "#if 0" (two spaces) doesn't match. http://www.jedit.org/users-guide/mode-rule-span-regexp.html But this is easy to fix. HASH_CHAR="#" is a solution. Second problem is that, in contrast of the range comment /* ... */, #if directive can be nested. Thus, simple SPAN_REGEXP doesn't match its behavior. This looks a bit difficult to solve. Another special rule set, say "CPP_SKIPPED", may be required. Last problem is care about #else, #elif, #if 1 ... #else. Looks too difficult for now, at least for me. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=300588&aid=2023939&group_id=588 |