News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Column editing in C::B 12.11

Started by fubo, February 13, 2013, 06:15:01 PM

Previous topic - Next topic

fubo

Hi all,
I noticed that column editing in C::B 12.11 is totally broken, am I right?
Thanks.

oBFusCATed

(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!]

fubo

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.

Jenna

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).

fubo


oBFusCATed

Quote from: jens on February 13, 2013, 06:59:31 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!]

Jenna

Quote from: oBFusCATed on February 13, 2013, 08:43:32 PM
Quote from: jens on February 13, 2013, 06:59:31 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).

oBFusCATed

Quote from: jens on February 13, 2013, 09:23:08 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!]

Jenna

Quote from: oBFusCATed on February 13, 2013, 09:54:30 PM
Quote from: jens on February 13, 2013, 09:23:08 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.
Good catch, I found the "evil" plugin, it's the spellchecker.

Quote from: fubo on February 13, 2013, 07:03:42 PM
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.


oBFusCATed

Quote from: jens on February 14, 2013, 06:14:05 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!]

fubo

Quote from: jens on February 14, 2013, 06:14:05 AM
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!

danselmi

Quote from: jens on February 14, 2013, 06:14:05 AM
Good catch, I found the "evil" plugin, it's the spellchecker.
I will look into it
spell checker plugin: [url="http://developer.berlios.de/projects/spellchecker/"]http://developer.berlios.de/projects/spellchecker/[/url]
nassi shneiderman plugin: [url="http://developer.berlios.de/projects/nassiplugin"]http://developer.berlios.de/projects/nassiplugin[/url]

danselmi

#12
I still don't know what the problem is:


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?

spell checker plugin: [url="http://developer.berlios.de/projects/spellchecker/"]http://developer.berlios.de/projects/spellchecker/[/url]
nassi shneiderman plugin: [url="http://developer.berlios.de/projects/nassiplugin"]http://developer.berlios.de/projects/nassiplugin[/url]

Jenna

Quote from: danselmi on February 15, 2013, 11:34:27 AM
I still don't know what the problem is:


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.

Jenna

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.