PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Position of "found text" line in editor window?  (Read 256 times)

Bruce Huber

  • Little Newbie
  • *
  • Posts: 29
Position of "found text" line in editor window?
« on: March 27, 2020, 11:55:21 PM »

Is there any configuration setting I can make to have the editor position the line of "found text" in the center of the window if the line was out of sight before being found?

It's not as bad when the "found" line was off-screen "up there" and it gets positioned as the first line in the window... but when it was off-screen "down there" somewhere, and it gets positioned as the last line in the window, that just means that I have a lot of scrolling or arrow keys before I can get enough of the code to see the context and figure out if that's what I was looking for. When an off-screen line pops into the center of the screen, it's much more productive.

I've set up AkelPad and other editors in the past to behave this way, but I don't see many exposed editor options in WinFBE. Am I just missing some settings somewhere?

Thanks!
Bruce
Logged

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 9219
  • Windows 10
    • PlanetSquires Software
Re: Position of "found text" line in editor window?
« Reply #1 on: March 28, 2020, 07:56:52 AM »

I know what you are describing. I will see if I can do to make WinFBE better position found search text in the center of the screen. I remember way back in the early days of writing the editor that I tried such an approach. I can't remember now off the top of my head why I abandoned it. Maybe at the time I didn't know as much about the Scintilla editing component as I do now. I'll try again.

With most of the world in lock down because of the virus, I seem to have a fair amount of time on my hands now to do programming.
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 9219
  • Windows 10
    • PlanetSquires Software
Re: Position of "found text" line in editor window?
« Reply #2 on: March 28, 2020, 09:14:12 AM »

Well, that was easier than I thought that it would be. I just need to add this code when repositioning to the found search item:

      ' Attempt to position the found selection in the center of the screen
      dim as long numLinesOnScreen
      numLinesOnScreen = SciExec( hEdit, SCI_LINESONSCREEN, 0, 0)
      SciExec( hEdit, SCI_SETFIRSTVISIBLELINE, currentLine - (numLinesOnScreen / 2), 0)

I'll start adding the code to the places in the editor that needs repositioning.
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 9219
  • Windows 10
    • PlanetSquires Software
Re: Position of "found text" line in editor window?
« Reply #3 on: March 28, 2020, 10:40:50 AM »

This has now been implemented. I have also added an Environment Settings / Code Editor option called "Position searches to middle of screen" to enable/disable the functionality.
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Bruce Huber

  • Little Newbie
  • *
  • Posts: 29
Re: Position of "found text" line in editor window?
« Reply #4 on: March 28, 2020, 04:03:17 PM »

I don't know if you drink root beer, near-beer, or Guinness (the real beer)... but "I love you man!"... and I'm starting to owe you bunches of beers!

Thanks!
Bruce
Logged

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 9219
  • Windows 10
    • PlanetSquires Software
Re: Position of "found text" line in editor window?
« Reply #5 on: March 28, 2020, 04:26:40 PM »

Lol, nope I'm not that much of a drinker.... maybe a Diet Pepsi will suffice. :)
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Josť Roca

  • Guru Member
  • *****
  • Posts: 3255
Re: Position of "found text" line in editor window?
« Reply #6 on: March 28, 2020, 10:42:36 PM »

I almost never drink beer or soft drinks. I drink wine or water.

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 9219
  • Windows 10
    • PlanetSquires Software
Re: Position of "found text" line in editor window?
« Reply #7 on: March 29, 2020, 11:04:22 AM »

Wine is something that I have never been able to acquire a taste for. Maybe I should be trying some of those Spanish wines!  :-)
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Josť Roca

  • Guru Member
  • *****
  • Posts: 3255
Re: Position of "found text" line in editor window?
« Reply #8 on: March 29, 2020, 01:03:22 PM »

A good wine deserves a good meal; otherwise, you spoil its taste. If you're going to eat a burger or an "American pizza", better drink a beer. Wine is a very ancient cultural tradition in the Mediterranean countries, although the eating and drinking habits are changing for the worse. And with the climate change, maybe our winegrovers will have to move to Sweden or Canada.