Author Topic: SmartIndentPlugin(s)  (Read 6407 times)

Offline danselmi

  • Developer
  • Almost regular
  • *****
  • Posts: 203
SmartIndentPlugin(s)
« on: July 16, 2008, 05:16:55 pm »
Hi

Here is a smart indent plugin for VHDL and Verilog (two hardware description languages).
A SmartIndent plugin attempts to indent your source while you are typing.
There is a small lib (called SmartIndentFunctor) to simplify the creation of other smart indent plugins.

The PascalSmartIndent plugin (also in the attached file) is used to demonstrate the simple usage of the lib.
(patch id 002517 at berlios contains a lexer configuration for pascal).

I tested it on Windows platform, is someone willing to create project file for another platform?

Regards daniel


[attachment deleted by admin]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: SmartIndentPlugin(s)
« Reply #1 on: July 16, 2008, 06:10:49 pm »
A SmartIndent plugin attempts to indent your source while you are typing.
Mind explaining this a bit more? I don't really get what these plugins are supposed to do...?!
(Sorry for probably being dumb... it's late... ;-)).
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline danselmi

  • Developer
  • Almost regular
  • *****
  • Posts: 203
Re: SmartIndentPlugin(s)
« Reply #2 on: July 16, 2008, 06:24:22 pm »
Hi

Codeblocks is already doing smart indent for C/C++:
After you hit Enter it will insert additional spaces/tab to the new line if the last char on
the previous line (where you pressed enter) was a '{'.

If you pushed the '}' key (on a empty line), cb searches for the corresponding '{' and
corrects the current indentation.

(Well currently cb does "smart" unindent independent of the selected lexer,
which is IMHO a bug, see attached patch)


This plugins are doing the "same" thing for vhdl, verilog and pascal.
Because with other languages blocks start with begin/end...


Was this a bit clearer?

regards daniel



[attachment deleted by admin]