• Welcome to PlanetSquires Forums.
 

Position of "found text" line in editor window?

Started by Bruce Huber, March 27, 2020, 11:55:21 PM

Previous topic - Next topic

Bruce Huber

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

Paul Squires

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.
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Paul Squires

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.
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Paul Squires

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.
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Bruce Huber

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

Paul Squires

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

José Roca

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

Paul Squires

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

José Roca

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.