rizonesoft / Notepad3

Notepad like text editor based on the Scintilla source code. Notepad3 based on code from Notepad2 and MiniPath on code from metapath. Download Notepad3:
https://www.rizonesoft.com/downloads/notepad3/
Other
4.96k stars 331 forks source link

Option request: SCI_SetEndAtLastLine(false) #368

Closed alex-ilin closed 6 years ago

alex-ilin commented 6 years ago

Please, add an option to scroll past EOF, the way ScrollPastEOF plugin for Notepad++ does.

Essentially, to enable the feature all you need to do is issue the following command to Scintilla (pseudocode):

SendMessage(scintillaHandle, SCI_SETENDATLASTLINE, 0, 0);

To revert to default behavior:

SendMessage(scintillaHandle, SCI_SETENDATLASTLINE, 1, 0);

Scintilla documentation link: http://www.scintilla.org/ScintillaDoc.html#SCI_SETENDATLASTLINE I think, to configure it a new item in the View menu would be enough (plus, store it in the ini-file, of course).

Thank you for considering this!

RaiKoHoff commented 6 years ago

@AlexIljin : Please try beta version 3.18.220.898. (To describe to beta channel, see #160) (For new members, a temporary quick access : here)

alex-ilin commented 6 years ago

@RaiKoHoff: I have tried the 64-bit portable version (copied only the Notepad3.exe to my existing installation), and it works completely as expected! Great job, man! One thing I noticed is that the Notepad3.exe file size is about 120Kb larger than the 64-bit v3.18.131.862 that I was using earlier. This seemed like a large jump in size to me, something to pay attention to.

RaiKoHoff commented 6 years ago

@AlexIljin : you are absolutely right. I always pay attention on file size, a hint for intrusion of any kind.... But this growth is okay: If you take a look at the upcoming release notes, you will see why ... 😜 (Beside the new lexer for R-Statistics, the main reason are optimization options for the compilation in VS2017 : "speed" -> "full optimization", which blows up the executable by 10%)

craigo- commented 6 years ago

@rizonesoft, do you build in the same way? Or is this specified in a makefile or some such?

rizonesoft commented 6 years ago

@craigo- I build the same way. Consistency is key. 😉

RaiKoHoff commented 6 years ago

@craigo- : Small differences in sizes between beta and release may result from different settings of the UPX compressor. The betas are compressed using PortableApps's AppCompactor, using recommended default option "NRV2E", Derick uses "BRUTE" for his release, I think? (Older betas (prior last release) have been not compressed)

image

RaiKoHoff commented 6 years ago

I created two beta versions of NP3 for speed measurements:

Last bullet point are current compiler settings for betas (and except NRV2E for release also). If there is no difference in speed, we should go for first bullet point settings (optimized size).

Hint for speed testing:

rizonesoft commented 6 years ago

@RaiKoHoff I can see no difference in speed. We should go for bullet point one. Thanks. 😄

RaiKoHoff commented 6 years ago

@rizonesoft : I will send the corresponding PullRequest soon ...

RaiKoHoff commented 6 years ago

@rizonesoft : I recommend to use UPX Compactor option NRV2E (same as in AppCompactor) for the release (reduces compatibility issues). Or even no compression, if this reduces "false positive detections" of AVs. (Sorry @AlexIljin , we misuse your enhancement request for this discussion)

alex-ilin commented 6 years ago

No problem. Speaking of performance, there is a noticeable difference in startup time between this 64-bit beta and the 64-bit release version 3.18.131.862 that I've been using before. When I start the release app, I see its window appear immediately, it feels very responsive. When I start the beta, it appears with about half a second delay, which feels sluggish. I noticed no difference in performance, only the startup time. Could that be due to difference in compression method and/or extra attention from the built-in Windows anti-virus scanner? I don't have a third-party antivirus, and I'm on Win10Prox64.

RaiKoHoff commented 6 years ago

Regarding startup-time differences, there maybe different OS related reasons:

alex-ilin commented 6 years ago

Look, I did everything right. I put the two exe-files into subfolders of one folder (i.e. the same physical disk). Then I start-close-start-close the release version repeatedly 5-6 times (by pressing Enter and Escape on keyboard), and I see no delay. Then I do the same with the beta version, and I see a startup delay every time. Going back to start-stopping the first exe - no delay again. One is very fast, the other has about one second startup delay. The background processes are idle (I'm looking at Process Explorer). The hard drive is SSD. Both exes have identical ini-files next to them.

RaiKoHoff commented 6 years ago

Are we still talking about beta version 3.18.220.898 ? I am not able to reproduce this issue on my machine (Win7 x64, HDD, Intel Xeon W3670 3200 MHz, ESET NOD32 AV). On my other machine (Win10 x64, SSD, Intel Core i7-4790 CPU @ 3.60GHz, Avira/Bitdefender/QVM II AI) I am also not able to reproduce this issue.

alex-ilin commented 6 years ago

@RaiKoHoff: yep, the very same.

craigo- commented 6 years ago

I’ll run similar tests sometime in the next 8 hours.

hpwamr commented 6 years ago

I've run test on a log file of 63,5MB and 500,000 lines with Notepad3Portable_size_3.18.222.903 and Notepad3Portable_speed_3.18.222.903. Test of replacing items (Ctrl+H:, sometimes a very little advantage for at "speed" Eg; replacing of 8617 items: 28sec instead of 31sec. Eg; replacing of 30182 items +/- 1min 36sec for both version.

RaiKoHoff commented 6 years ago

Available beta version 3.18.222.904 will have a big performance boost on the replacing text issue ...

craigo- commented 6 years ago

I believe I have found the series of circumstances that causes the slow launch times that @AlexIljin is describing.

Findings:

In summary, it looks to me like something happened in beta build 885 and later that Windows Defender Real-time protection doesn't like, which somehow doesn't present in the release build.

Methodology:

Test Environment 1:

Test Environment 1 - Test Results:

Test Environment 2:

Test Environment 2 - Test Results:

Test Environment 3:

Test Environment 3 - Test Results:

Test Environment 4:

Test Environment 4 - Test Results:

Key:

alex-ilin commented 6 years ago

@craigo-: such a thorough investigation! Respect, man! Could the reason for startup slowdown be a change in the executable packing options?

craigo- commented 6 years ago

@AlexIljin, @RaiKoHoff, perhaps... Look at the executable size change:

craigo- commented 6 years ago

My earlier thought was that the slow launch might be related to Portable Notepad3 struggling to find its Notepad3.ini file... There is a difference between a pristine unpacked release build (which uses the Notepad3.ini file in the executable's folder), and a pristine unpacked beta build (which doesn't).

But I discarded that theory because the slowness is present in some beta builds (885+) and not others.

RaiKoHoff commented 6 years ago

@craigo- : Wow! I appreciate such a comprehensive investigation - Thank you a lot :heart:

For beta builds, I am using the PortableApps building batch script and create an additional .ZIP file from the resulting package for convenience. Between 884b and 885b builds, I added the AppCompactor step, which uses UPX Compressor for executables (mode NRV2E).

Other discontinuously jumps in file sizes are related to changed compiler options (see discussion at). Current release (222.905) is back to "Maximize Speed (/O2)" combine with 2nd opt. "Favor Size or Speed: Favor small code (/Os)". Beta builds between ~Feb.01 until ~Feb.21 have been build with "Full Optimization (/Ox)" combine with 2nd opt. "Favor Size or Speed: Favor fast code (/Ot)" which results in a bigger file size (~10%++).

RaiKoHoff commented 6 years ago

It seems, that Windows Defender does not like unknown executable (naturally, every new beta has another file hash) combined with UPX compression. Don't know if "Full Optimization" option has an impact too? Future betas should be build with "Maximize Speed (/O2)" combine with 2nd opt. "Favor Size or Speed: Favor small code (/Os)" and no UPX compression.

RaiKoHoff commented 6 years ago

@AlexIljin : Please test release version 3.18.223.908 and close this issue if solved.

(If the off-topic stream regarding file sizes and startup-times needs further discussion, this should be done in a new separate issue (referencing this one)).

alex-ilin commented 6 years ago

@RaiKoHoff: the new option works as expected, the file size increase is reasonable and the startup time is back to normal in the release. Thanks for the great work!