Author Topic: Editor capabilities  (Read 5856 times)

Offline mijewen

  • Multiple posting newcomer
  • *
  • Posts: 19
Editor capabilities
« on: July 07, 2014, 03:54:00 pm »
Folks,

Is it safe to assume (probably not!) that the editor in use by C::B is a modified NotePad++ ?  If not, then please disregard the rest of this post.

I use a laptop PC running Windows XP.

I really like the way C::B suggests what you may want to type, and offers structure members etc, which can simply be selected - I think that's really clever and very useful, and I wouldn't want to lose it by forcing the use of regular NP++ (even if I figured out how to do it), but if the C::B editor is based on NP++, as I suspect, would it be possible for me to incorporate some of NP++'s attributes?  Could you tell me how to do it?  The NP++ features that I really miss are ....

a) In NP++, if the Alt key is held while dragging the mouse downwards, or Alt-Ctrl are held while pressing up/down arrows, it makes a vertical cursor line that can be many lines deep.  C::B editor does that too (which makes me think it is probably based on NP++ code).  However, in NP++, if I then type, my characters appear in vertical columns on all of the lines covered by the cursor.  In C::B, this does not happen.  This function is useful when enclosing an existing block of code (eg, an if() statement) inside a new block (eg, a for( ;; ) loop) that is being added.  A vertical cursor can span all of the lines of the original block - the if( ;; ) - and if spaces are typed, they are inserted in front of each line, and the  entire block moves to the right to correct the indentation.  Similarly, the Del key, or Delete-left, can be used to move a block to the left.

b) In C::B, the search does not work properly - there are radio buttons for searching up or down.  Repeat search is F3, but if Search-up is selected, F3 always searches down.  Also, if a word is highlighted, then Search invoked, the word is used as a search string, but Search does not find the next occurrence above or below - it finds the one that is already highlighted, and then F3 searches only downward.  If the cursor is not on the string to be searched for, it must be manually typed into the search field (oh! the work involved!), so this editor looks a bit clunky in this respect when compared with the standard NP++ release, which also has a Search-again button in the search box (F3 also works).  Of course, you don't want the Search box to overlay the screen after the search, but NP++ overcomes that by allowing the Search box to be set so transparent that text is easily read through it, and it becomes opaque again when clicked.

c) NP++ has a find-and-replace function, which would prove useful when a decision is made that a variable name should be changed to something more descriptive throughout a function or even an entire file if the variable is global.

d) In NP++, if Shift-Ctrl are held while pressing the up or down arrow, then the line on which the cursor is sitting, or the highlighted block, will be moved up and down the document.  The C::B editor can't do that, but it would be useful when, for example, it is discovered that a line of code has been written before another, when it should have been after, or a function follows another when  it should have preceded it.

I know that all of these things are merely inconveniences and can be manually worked around quite easily, but I have become so used to using them in NP++ that I have come to depend on them.  If convenience didn't matter, we would all still be using WordPad!

Thanks... Mij.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Editor capabilities
« Reply #1 on: July 07, 2014, 04:54:31 pm »
Is it safe to assume (probably not!) that the editor in use by C::B is a modified NotePad++ ?
no, c::b bases on scintilla: http://www.scintilla.org/SciTE.html

b) In C::B, the search does not work properly - there are radio buttons for searching up or down.  Repeat search is F3, but if Search-up is selected, F3 always searches down.  Also, if a word is highlighted, then Search invoked, the word is used as a search string, but Search does not find the next occurrence above or below - it finds the one that is already highlighted, and then F3 searches only downward.  If the cursor is not on the string to be searched for, it must be manually typed into the search field (oh! the work involved!), so this editor looks a bit clunky in this respect when compared with the standard NP++ release, which also has a Search-again button in the search box (F3 also works).  Of course, you don't want the Search box to overlay the screen after the search, but NP++ overcomes that by allowing the Search box to be set so transparent that text is easily read through it, and it becomes opaque again when clicked.
i personally prefer the incremental search from the toolbar with the highlight function and the forward and backward buttons

c) NP++ has a find-and-replace function, which would prove useful when a decision is made that a variable name should be changed to something more descriptive throughout a function or even an entire file if the variable is global.
Mark the symbol->Right click->Code refactoring -> rename symbol

greetings

Offline mijewen

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: Editor capabilities
« Reply #2 on: July 07, 2014, 06:10:27 pm »
Thanks for these answers

Quote
c::b bases on scintilla
Yes, I looked it up on Wikipedia, and apparently so does NP++, so they are both children of the same parent, and as we all know, brothers and sisters usually do things differently!

Quote
i personally prefer the incremental search from the toolbar with the highlight function and the forward and backward buttons
I'm so used to pressing Ctrl-F (Find) that I hadn't even noticed the Search toolbar.  Thanks for pointing it out.  That'll do it for me.

Quote
Mark the symbol->Right click->Code refactoring -> rename symbol
Thanks for this too, though it doesn't allow the flexibility of Search/Replace.  Still, I guess I can live with it.  It's not something I want all that often anyway.

I also found (by accident) an answer to my point (d).  You can move a highlighted block, or the cursor line, by holding Alt and using the up/down arrows.  I wonder if there's an answer to my point (a) lurking somewhere.

Is there an editor specification anywhere that gives all the features and how to use them?  For example, split screen, etc?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Editor capabilities
« Reply #3 on: July 07, 2014, 09:04:25 pm »
a) It works (alt+left mouse drag), but you probably need to enable something in the settings.
d) Use alt and you'll have this feature.
(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 mijewen

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: Editor capabilities
« Reply #4 on: July 07, 2014, 11:46:43 pm »
Quote
a) It works (alt+left mouse drag), but you probably need to enable something in the settings.
Does it work completely for you?  For me, if I hold Alt and drag the mouse down, it does make a vertical line spanning as many rows as I want, but when I type, let's say an 'A', it just prints a single A at the bottom of the vertical line (which then disappears).  With NP++, the same operation writes a column of A's, one on each row that is spanned by the vertical line, and the line doesn't go away - it waits for more key-presses.  Of course, its real utility is when I type a space.  Writing the same text onto several lines at once is rarely useful.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Editor capabilities
« Reply #5 on: July 08, 2014, 01:25:31 am »
Yes, it works... check the settings about virtual space or something like that...
(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 Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Editor capabilities
« Reply #6 on: July 08, 2014, 02:38:25 am »
Settings->Editor->Margins and caret->Selections: "Allow multiple selections", "Enable typing in ..."

Offline mijewen

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: Editor capabilities
« Reply #7 on: July 08, 2014, 05:26:49 pm »
Aha!  That does it. 
Many thanks to all who answered.

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Editor capabilities
« Reply #8 on: July 08, 2014, 11:28:03 pm »
Quote
Mark the symbol->Right click->Code refactoring -> rename symbol
Thanks for this too, though it doesn't allow the flexibility of Search/Replace.  Still, I guess I can live with it.  It's not something I want all that often anyway.
Not sure if you found it yet; there is a Replace (+/- in Files) under Search->Replace (default bindings: Ctrl+R and Ctrl+Shift+R).