Author Topic: cbEVT_EDITOR_NEW_LINE event ?  (Read 6404 times)

Offline mmkider

  • Almost regular
  • **
  • Posts: 150
cbEVT_EDITOR_NEW_LINE event ?
« on: January 04, 2009, 03:51:54 pm »
Hi codeblocks team,
Breakpoint and bookmark need cbEVT_EDITOR_NEW_LINE event for change location.
But I can't find cbEVT_EDITOR_NEW_LINE event.
Any solutions?

Thank you for your reply.



Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9699
Re: cbEVT_EDITOR_NEW_LINE event ?
« Reply #1 on: January 04, 2009, 04:58:13 pm »
Any solutions?
You may want to provide a patch accordingly - have a look how the other cbEVT_EDITOR_XXX events are implemented.

But are you aware that this event would be thrown ~ a million times and would certainly cost performance?
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 thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: cbEVT_EDITOR_NEW_LINE event ?
« Reply #2 on: January 05, 2009, 09:32:00 am »
I would not worry about performance in this case, since an event is sent for every editor update already, which is whenever you hit a key or move the mouse.
It kind of makes a separate "new line" event obsolete, however. The editor implements the "smart indent" feature (which basically needs a "new line event") using the editor update event too.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline dje

  • Lives here!
  • ****
  • Posts: 682
Re: cbEVT_EDITOR_NEW_LINE event ?
« Reply #3 on: January 05, 2009, 11:07:49 am »
Hi !

Don't forget to manage copy/paste events that can introduce new lines!
I don't know if new lines events are triggered only when a carriage return keypress is detected...

Dje

Offline mmkider

  • Almost regular
  • **
  • Posts: 150
Re: cbEVT_EDITOR_NEW_LINE event ?
« Reply #4 on: January 05, 2009, 04:10:09 pm »
Now I have only thought of the three applications(Bookmarks、Breakpoint、Navigate Forward and Navigate Backward)

However, I think that the SDK of codeblocks more clearly in the delivery of cbEVT_EDITOR_NEW_LINE(S?).

I feel that many problems to be considered for the implementation of the cbEVT_EDITOR_NEW_LINE(S?).

Thank you for your response.