NotepadNext icon indicating copy to clipboard operation
NotepadNext copied to clipboard

The cursor is re-positioned to beginning after content is updated

Open stephen9357 opened this issue 7 months ago • 4 comments

Operating System and Version

Windows 11 22631.4037 x64

Distribution

NotepadNext-v0.11-win64.zip

Description

When NotepadNext window regains the focus, if the file content is updated, the cursor will be re-positioned to the beginning of the file instead of maintaining the previous position, which is a big disadvantage for analyzing log files.

Steps to Reproduce

  1. Open a log file while it's continuously writted to
  2. Click any other window to make NotepadNext window lose focus
  3. Click NotepadNext window to regain focus, make sure it automatic update the content, cursor is re-positioned to beginning

Debug Information

Notepad Next v0.11.0.0 Build Date/Time: Apr 2 2025 02:10:30 Qt: 6.5.3 OS: Windows 11 Version 23H2

Additional Details

e.g. screenshots, logs, etc

stephen9357 avatar May 21 '25 08:05 stephen9357

Hello, I would like to take up this issue, if no one else has already taken it up. Thanks!

noobyogi0010 avatar Jun 20 '25 17:06 noobyogi0010

As far as I know nobody else is working on it.

My best guess is this function https://github.com/dail8859/NotepadNext/blob/4fc361ab8433b706877a3ce9e941ef47b5022261/src/NotepadNext/ScintillaNext.cpp#L324-L353 would need modified to save the current selection (maybe also the view location) and then after the file is restored set the position and view.

dail8859 avatar Jun 20 '25 17:06 dail8859

Cool, I'll give it a go this week. Okay, so I'll get the current position and the view, and store them temporarily and once the file has been restored I'll set the position and the view. Thank you!

noobyogi0010 avatar Jun 23 '25 18:06 noobyogi0010

Cool, I'll give it a go this week. Okay, so I'll get the current position and the view, 和 store them temporarily and once the file has been restored I'll set the position and the view. Thank you!

Is there any progress?

lucienlmy avatar Nov 09 '25 08:11 lucienlmy