Author Topic: How to center text? (always show text ahead)  (Read 2748 times)

Offline visir

  • Multiple posting newcomer
  • *
  • Posts: 76
How to center text? (always show text ahead)
« on: December 18, 2017, 07:42:48 pm »
When I'm using arrow keys to scroll through source code, cursor is at the very bottom of the "text subwindow". I don't see ahead.

I'd like for codeblocks to always show 3 lines ahead of cursor (or more). In emacs, I do this with "(setq scroll-margin 4)".
« Last Edit: December 19, 2017, 06:46:32 am by visir »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: How to center text? (always show text ahead)
« Reply #1 on: December 18, 2017, 08:18:30 pm »
If you have the EditorTweaks-plugin installed (on linux you need the codeblocks-contrib package), you can go change "Settings -> Editor -> Editor Tweaks -> Editor caret buffer".

Offline visir

  • Multiple posting newcomer
  • *
  • Posts: 76
Re: How to center text? (always show text ahead)
« Reply #2 on: December 19, 2017, 06:49:41 am »
Doesn't work with debugger. Doesn't center when I'm stepping through code.

What should I change in the source code, where I should look? I have it compiled here.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: How to center text? (always show text ahead)
« Reply #3 on: December 19, 2017, 10:12:14 am »
Look at cbDebuggerPlugin::SyncEditor and cbEditor::GotoLine.

I guess it will be a good idea to move the editor tweak setting in the core so it could be respected in more places.
(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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: How to center text? (always show text ahead)
« Reply #4 on: February 17, 2018, 12:47:53 am »
Implemented in rev11296... Thanks for reporting...
(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!]