Author Topic: Column editing in C::B 12.11  (Read 11052 times)

Offline fubo

  • Multiple posting newcomer
  • *
  • Posts: 38
Column editing in C::B 12.11
« on: February 13, 2013, 06:15:01 pm »
Hi all,
I noticed that column editing in C::B 12.11 is totally broken, am I right?
Thanks.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Column editing in C::B 12.11
« Reply #1 on: February 13, 2013, 06:31:03 pm »
Explanation? Example?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline fubo

  • Multiple posting newcomer
  • *
  • Posts: 38
Re: Column editing in C::B 12.11
« Reply #2 on: February 13, 2013, 06:35:13 pm »
Example1: pressing ALT and drawing a vertical line, I want to write an all lines. It writes only on latest.
Example2: pressing ALT and drawing a vertical line, pressing TAB should indent the text to the right. Now it makes a lot of mess deleting pieces of text.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Column editing in C::B 12.11
« Reply #3 on: February 13, 2013, 06:59:31 pm »
The first works if you set the options in "Settings -> Editor -> Margins and caret -> Selections" correctly.
The second does not work and might be a bug or a scintilla limitation ( I will see if I find the time to look into it deeper).

Offline fubo

  • Multiple posting newcomer
  • *
  • Posts: 38
Re: Column editing in C::B 12.11
« Reply #4 on: February 13, 2013, 07:03:42 pm »
Thanks, example 1 is now working.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Column editing in C::B 12.11
« Reply #5 on: February 13, 2013, 08:43:32 pm »
The second does not work and might be a bug or a scintilla limitation ( I will see if I find the time to look into it deeper).
It works in scite and I think our smart indenter messes things.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Column editing in C::B 12.11
« Reply #6 on: February 13, 2013, 09:23:08 pm »
The second does not work and might be a bug or a scintilla limitation ( I will see if I find the time to look into it deeper).
It works in scite and I think our smart indenter messes things.
If all smartindent-plugins are switched off it still does not work.
But it works as expected, if I select several lines with Ctrl-key pressed.
So it might be an issue with rectangle-selection (with width 0 in this special case).

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Column editing in C::B 12.11
« Reply #7 on: February 13, 2013, 09:54:30 pm »
If all smartindent-plugins are switched off it still does not work.
For me it works if I compile cb with cb, no contrib plugins. Gentoo linux, latest head.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Column editing in C::B 12.11
« Reply #8 on: February 14, 2013, 06:14:05 am »
If all smartindent-plugins are switched off it still does not work.
For me it works if I compile cb with cb, no contrib plugins. Gentoo linux, latest head.
Good catch, I found the "evil" plugin, it's the spellchecker.

Thanks, example 1 is now working.
If you either disable the spellchecker-plugin completetely via "Plugins -> Manage plugins" or at least disable online spellchecking from "Settings -> Editor -> SpellChecker" the second example should work also.


Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Column editing in C::B 12.11
« Reply #9 on: February 14, 2013, 08:15:50 am »

Good catch, I found the "evil" plugin, it's the spellchecker.
Strange...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline fubo

  • Multiple posting newcomer
  • *
  • Posts: 38
Re: Column editing in C::B 12.11
« Reply #10 on: February 14, 2013, 01:01:33 pm »
If you either disable the spellchecker-plugin completetely via "Plugins -> Manage plugins" or at least disable online spellchecking from "Settings -> Editor -> SpellChecker" the second example should work also.
Thanks! I confirm it on Win7 x64. Now it works!

Offline danselmi

  • Developer
  • Almost regular
  • *****
  • Posts: 203
Re: Column editing in C::B 12.11
« Reply #11 on: February 14, 2013, 06:20:37 pm »
Good catch, I found the "evil" plugin, it's the spellchecker.
I will look into it

Offline danselmi

  • Developer
  • Almost regular
  • *****
  • Posts: 203
Re: Column editing in C::B 12.11
« Reply #12 on: February 15, 2013, 11:34:27 am »
I still don't know what the problem is:

Code
void OnlineSpellChecker::DoSetIndications(cbEditor* ctrl)const // called OnUpdate
...
    if(stc->SelectionIsRectangle() || (stcr && stcr->SelectionIsRectangle())) return; // workaround so Example2 is working
    stc->IndicatorSetStyle(GetIndicator(), wxSCI_INDIC_SQUIGGLE);
    // when we return here, after IndicatorSetStyle() the Example 2 is not working
...

Any ideas?

« Last Edit: February 15, 2013, 12:21:39 pm by danselmi »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Column editing in C::B 12.11
« Reply #13 on: February 15, 2013, 02:11:32 pm »
I still don't know what the problem is:

Code
void OnlineSpellChecker::DoSetIndications(cbEditor* ctrl)const // called OnUpdate
...
    if(stc->SelectionIsRectangle() || (stcr && stcr->SelectionIsRectangle())) return; // workaround so Example2 is working
    stc->IndicatorSetStyle(GetIndicator(), wxSCI_INDIC_SQUIGGLE);
    // when we return here, after IndicatorSetStyle() the Example 2 is not working
...

Any ideas?


I see if I find the time to look into it this weekend.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Column editing in C::B 12.11
« Reply #14 on: February 15, 2013, 10:56:36 pm »
Please test the attached patch and give feedback.

It uses the already existing oldCtrl to ensure the calls to IndicatorSetStyle(), IndicatorSetForeground() and IndicatorSetUnder() are done only once for each control and not every time DoSetIndications() is called.

Ths will work unless another part of C::B will use (amd modify) the same indicator, what (most likely) works with the existing code, but would probably lead to other issues.