Recent

Author Topic: [SOLVED] TSynPluginSyncroEdit not in sync.  (Read 2990 times)

Basile B.

  • Guest
[SOLVED] TSynPluginSyncroEdit not in sync.
« on: April 19, 2015, 01:00:57 pm »
Hi, I have an editor which uses a TSynPluginSyncroEdit.

For a reason i don't get, it starts failing after a while, e.g i select a piece of code, activate the synchro, modify an identifier but only the focused one is changed, not the other matches.

- the problem only happen after a while.
- the plugin is shared, e.g, i change the active document and sets the editor accordingly.

exact usage can be found here:

https://github.com/BBasile/Coedit/blob/master/src/ce_editor.pas#L304

(as you can see, there nothing exotic: create/set icon/set editor, e.g not any crazy code that would fuck up the thing...)


Any idea of the problem origin ?
« Last Edit: April 20, 2015, 12:26:31 am by Basile B. »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9913
  • Debugger - SynEdit - and more
    • wiki
Re: TSynPluginSyncroEdit not in sync.
« Reply #1 on: April 19, 2015, 02:35:55 pm »
I'' look at the code later. BUt if you share it between many editors:

Make sure you never change the editor while it is active.

Not sure what happens when there is a selection. AS that also creates some info stored on the plugin which is lost if the editor is changed.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9913
  • Debugger - SynEdit - and more
    • wiki
Re: TSynPluginSyncroEdit not in sync.
« Reply #2 on: April 20, 2015, 12:14:13 am »
I had a quick loo at the Syncro plugin.

You should create one per edit. It inherits from the default plugin, and therefore has the interface to store many edits.
But internally this is not implemented. There are thinks that get silently replaced when adding another editor.

Basile B.

  • Guest
Re: TSynPluginSyncroEdit not in sync.
« Reply #3 on: April 20, 2015, 12:26:03 am »
Thx for the diagnose.

 

TinyPortal © 2005-2018