#474 Some code corrections and refinements


Within this patch, some code corrections and refinements are gathered.
Patches are based on SVN 1036.

1.) Unused module "UniConversion"
The routines in "UniConversion.cpp, UniConversion.h" are not used. The modules can be deleted from the project.
Furthermore, files with the same names are present in scintilla!
Just delete "#include UniConversion.h" within FindReplaceDlg.cpp

2.) Delete bin\npp.pdb from Notepad++ SVN repository
That file seems unnecessary for the SVN repository and annoys always by signalling differences where no are present.

3.) Loading Time resolution too coarse -> new module ElapseTimer
The resolution of the displayed duration to load Notepad++ (e.g. command line parameter -loadingTime) is only full seconds and NOT as described in the Notepad++ documentation with a resolution of 0.01 seconds.
This is because the "time()" function is used, which only returns an integer giving the time in seconds.
This patch includes an additional module "ElapseTimer", which uses the more accurate PerformanceCounter.
This module can also be used to measure time differences down to micro-seconds or even nano-seconds allowing measurement of code execution times and compare it to alternative codings. Just include ElapseTimer.h for debugging purposes.
By the way, the code is stolen from Scintilla PlatWin.cxx because I couldn't figure out, how to access that internal Scintilla function.
(see Patch NppPatch_6.3.2_ElapseTimer.patch)

4.) Speed up getCurrentFoldStates()
The newly provided code using SCI_CONTRACTEDFOLDNEXT is usually 10%-50% faster than checking each line of the document!!
You can easily prove it using the ElapseTimer by including the ElapseTimer.h file for debugging and time measurement purposes.
(see Patch NppPatch_6.3.2_SpeedUp-GetFoldingStates.patch)

1 Attachments


<< < 1 2 (Page 2 of 2)
  • Don HO

    Don HO - 2013-06-09

    Thank you for the patches.
    The patch for getCurrentFoldStates() is committed in svn.
    However, the current timer won't be replaced by elapsetimer, since the benefice is small (to get mili-seconds value).


    Last edit: Don HO 2013-06-14
  • FLS

    FLS - 2013-06-09

    Don, thank you very much for the great text editor and your long lasting active maintenance.

    Most people won’t use the "-loadingTime" option, so its not to mention. However, in order to be consistent, I think it would be a good idea to adapt at least:
    a.) the printout of the start-up time from “%.2lf seconds” to “%.0lf seconds” not deluding an accuracy of 0.01 seconds;
    b.) correcting the Notepad++ online documentation for "-loadingTime" command line option, which states wrongly a resolution of 0.01 seconds, while the resolution is indeed only of full seconds.


  • Don HO

    Don HO - 2013-06-14


    I did as you you suggested.
    Thank you for your suggestion.


  • Don HO

    Don HO - 2013-07-03
    • status: accepted --> closed
<< < 1 2 (Page 2 of 2)

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks