Ticket #16 (closed defect: fixed) — at Version 12

Opened 16 years ago

Last modified 11 years ago

savannah: c is _not_ c++

Reported by: ossi Owned by: winnie
Priority: trivial Milestone: 4.6.2
Component: mcedit Version: 4.6.1
Keywords: Cc:
Blocked By: Blocking:
Branch state: merged Votes for changeset:

Description (last modified by ossi) (diff)

Original: http://savannah.gnu.org/bugs/?13144

Submitted by:Oswald Buddenhagen <ossi>Submitted on:Sat 21 May 2005 06:55:47 PM UTC
Category:EditorSeverity:3 - Normal
Status:None Privacy:Public
Assigned to:NoneOpen/Closed:Open
Release:current (CVS or snapshot)Operating System:All

Original submission:

highlighting c++ keywords like "class", "new", etc. in plain c 
files is outright wrong and consequently annoying.

the only problem are .h files, as their language is not obvious 
from the extension. i think the presence of class definitions is a 
sufficient criterion for c++, but recognizing them reliably 
requires a minimal parser - even regexps won't do ...

ps: don't tell me i shouldn't be using c++ keywords in c headers, 
because the header might be included in c++ files later - this is 
my business. 

Comment 1 by Jan Engelhardt <hirogen2> at Sun 06 Jul 2008 04:14:54 PM UTC:

So use .hpp for C++ header files ;-)

Change History

comment:1 Changed 16 years ago by slavazanko

So use .hpp for C++ header files ;-)

Or choose F9 -> Options -> Syntax Highlighting...

:)

Is this ticket INVALID?

Changed 16 years ago by winnie

This patch would fix this issue.

comment:2 Changed 16 years ago by winnie

  • Owner set to winnie
  • Status changed from new to accepted
  • Version set to 4.6.1
  • Milestone set to 4.6.2

My suggestion would be instead of closing it as invalid, use the attached patch in order to differenciate between c and cpp files.

.h files are parsed as c++ files per default.

Any comments on this patch?

comment:3 follow-up: ↓ 4 Changed 16 years ago by slavazanko

Strange line 76 in patch...

comment:4 in reply to: ↑ 3 Changed 16 years ago by winnie

Replying to slavazanko:

Strange line 76 in patch...

This is about highlighting e.g comments which are not catched by the keywords above.. therefore I think this should be okay

comment:5 Changed 16 years ago by slavazanko

Strange line 76 in patch...

Additional:
Strange line No 76 in syntax/cxx.syntax
Only for English, Spain, Germany,.. Not for Japan, Taiwan, Russian, Hebrew, etc.

But patch like to me in any case.

+1

comment:6 Changed 16 years ago by winnie

  • Keywords review added
  • Status changed from accepted to testing
  • Resolution set to fixed

comment:7 Changed 16 years ago by winnie

  • Keywords vote-slavazanko added

Added a vote-slavazanko as he already voted in the text.

comment:8 Changed 16 years ago by metux

  • Keywords approved,vote-slavazanko,vote-metux added; review vote-slavazanko removed

comment:9 Changed 16 years ago by metux

Got two votes, approved, can be applied now.

comment:10 Changed 16 years ago by winnie

  • Status changed from testing to closed

Okay.. fix merged into mc-4.6 and merged back into master.

comment:11 Changed 16 years ago by slavazanko

Duplicate #164

comment:12 Changed 11 years ago by ossi

  • Description modified (diff)
  • Branch state set to no branch
  • Reporter changed from slavazanko to ossi
Note: See TracTickets for help on using tickets.