#34 Update Session Restore Sub-View Settings + Other Bug Fixes


This patch includes several enhancements and bug-fixes of Npp 4.40
The provided source code listings are based on Npp 4.40 (SVN revision 52) source code. Included changes are commented. You easily can find the changes when comparing with the original files of Npp 4.40 source code.
Furthermore, most of the changes have inline comments starting with "//--LS:" and a special CommentCode which indicates to which update/patch the changes belong. Therefore, you could just take over the featurs you are interrested in very easily.

In the following, an overview on the enhancements and bug-fixes is given:

1.) Patch 1438277_commenting is included and updated.
- Update: Comparison with comment_string is now made case in-sensitive.
- CommentCode: Patch 1438277_commenting

2.) Patch [1747973] "File-Edit-View-History Enhancement" is included and updated.
(see also feature request []
This patch uses also changes made by "Session SubView restore" to restore the edit view of the document.
The edit view of a document (last cursor position, marks and bookmarks) is always restored when the document is loaded.
However, document view (MainView or SubView) is not restored so that the file is loaded into the current view window.
- CommentCode: FileEditViewHistory:

3.) Patch [1785174] "Ctrl-F4 and Ctrl-F6 Windows Compatibility Enh." is included.
Indeed, this patch includes two patches:
a.) Ctrl-F4 shortcut added, which closes the active document.
b.) In addition to Ctrl-TAB the Ctrl-F6 shortcut has been added, which moves directly between documents but without using the "document switcher list" menu. However, the Ctrl-F6 functionality could be made available without software change by changing Ctrl-TAB to Ctrl-F6 using the Shortcut-Mapper and disabling the document switcher list in the preference settings dialog.
- CommentCode: CtrlTabF6: and CtrlTabF4:

4.) Bug-Fix for [1825603] Split Focus not changing if non-focused 'active' tab clicked
When the user has documents in both edit views and clicks on a tab bar of the other edit view in order to activate a document there, it does not work. The user needs to click into the document window. But this moves the cursor to the location, where the user has clicked and does not leave the cursor at the position where the document was left. This odd behaviour has been corrected.
- CommentCode: OtherTabBarActivateDocument

5.) Configuration settings per user Enable/Disable preference setting dialog included.
Npp reads configuration settings either from the user private directory under "Documents And Settings\<username>\Application Data\Notepad++" or from the directory where notepad++.exe is installed.
This behaviour could now be set with a check-box in the Preference Settings dialog (MISC-Tab).
- CommentCode: ConfigurationSettingsPerUser

6.) Session Restore with Sub-View Settings
The functionality of "Session Restore with Sub-View Settings" feature, introduced in Npp 4.40, was updated:
a.) Bug-Fix for [1815426] - Clonning doesn't let start again NP++ -
Note: In Npp 4.50 it was announced that bug [1815426] was fixed. However, this is not fully true because the reported error condition is just by-passed. There are other conditions which still crash Npp 4.50 or cause a system error (see below in b.)).
b.) Functionality updated and enhanced.
- Files in both views are restored correctly now.
- If the user has already opened (loaded) files in one or in both views and he loads a session where this file is also included, the already opened files are restored correctly. However, the behaviour could be defined in the preference settings (MISC-Tab) to leave the already opened session files untouched.
- Npp does not crash if a file in the session exists but the user does not have the right to open it.
- No runtime error appears, when a session is loaded, then the last file is moved to the second view and the session is loaded again without closing all loaded files.
- CommentCode: Session SubView restore:

7.) Error message for "Load config.xml failed" and "Load stylers.xml failed" updated with path to the file.
- CommentCode: ConfigPathMessage

8.) Some bug fixes when writing and reading the history- and session- xml files.
- CommentCode: ReadingWritingHistory_SessionXMLFiles

9.) Preference Setting dialog (MISC-Tab) updated to control the above mentioned new functionalities:
- Session Setting: Restore sub-views when loading sessions.
- Session Setting: Apply session settings to already opened files.
- File Edit View History Setting: Max number of history files
- File Edit View History Setting: Enable File Edit View History
- Configuration settings per user
- There is no CommentCode for this but the individual CommentCodes of the single patches are used.

10.) Patch 1783889 "BugFix for #1783887 and #1757987" included.
- CommentCode: Patch 1783889_BugFix for #1783887 and #1757987

11.) Compile Date in About-dialog inserted.
This is just a private help to distinguish between several Npp executables used for testing.
When compiling the about.cpp file, the current compile date is automatically inserted/updated in the About-dialog.
- CommentCode: CompileDateInAboutDialog

However, because of the unlucky implementation of the "auto add extension" behaviour in save dialog implemented in v4.4, which has a back-draw.
It always replaces any extension with the one of the file type.
Therefore, just use the code provided within this version and update previous or later Npp-versions.



  • FLS

    Changed source files based on Npp 4.40

  • FLS

    Logged In: YES
    Originator: YES

    File Added: DifferencesToNpp440_fls071030.zip

  • FLS

    Logged In: YES
    Originator: YES

    This is an update of the above patches based on Source Code of Npp 4.70 (SVN-release 93)!
    In the official version of Npp 4.70 the following patches are
    already included: #1, #10 and #11.
    The patches #12 to #14, as described below, are new.
    Again, included changes are commented. You easily can find the
    changes when comparing with the original files of Npp source code.
    Furthermore, most of the changes have inline comments starting
    with "//--LS:" and a special CommentCode which indicates to which
    update/patch the changes belong.
    Therefore, you could just take over the featurs you are
    interrested in very easily.

    In the following, an overview on the enhancements and bug-fixes is given:

    12.) Icons for Comment and UnComment added to the Toolbar
    Block Comment/Uncomment enabled even with no selection.
    Then, the current line is commented/uncommented.
    If a File-Language has no block-comment, the stream-comment
    is called from the block-comment function.
    - CommentCode: IconAdd and BlockToStreamComment

    13.) Middle Mouse Button inserts selected text
    - CommentCode: MButtonCopyPaste

    14.) Uncommenting of stream-comment functionality added and
    cross-calling of block-comment and stream-comment added.
    Block Comment
    Comments either the current line or several lines if
    text of several lines is selected.
    If language does not support block-comment, the current
    line or the selected text is commented using stream-comment.

    Stream Comment
    Comments the selected text or the current line, if no text

    is selected.
    If language does not support stream-comment, the current
    line or all lines of selected text are commented
    using block-comment.

    First, the current line is \(or selected lines are\)

    un-commented using block-comment.
    If there was no block-comment, then a stream-comment
    around the beginning of the selection,
    around the end of the selection and all comments within
    the selection are un-commented.
    - Commentcode: unDoStreamComment

    File with updated source code added: DifferencesToNpp470_StreamUnComment_fls080104.zip


    File Added: DifferencesToNpp470_StreamUnComment_fls080104.zip

  • FLS

    Logged In: YES
    Originator: YES

    The above update of patches #12 - #14 had some bugs, which are fixed within this version:
    - Fix bug in patch #14 for commenting/uncommenting
    - Middle mouse button inserts selected text now with MButtonDOWN.
    It needs to get used to it, but it avoids scrolling the text before
    the middle mouse button is released.
    - Patch 1783889 - fix for bugs 1783887 and 1757987 got corrupted.
    Change of working directory when file opened from command line is
    now implemented again correctly.
    - Merged with updated of NPP 4.7.2 (SVN-rev. 98).

    Furthermore, another patch is introduced:
    15.) HelpInfo for command line parameters
    With the command line parameter -help or /? a message window is opened,
    which describes the available command line parameters.
    Furthermore, command line parameters are now case in-sensitive.
    - Commentcode: HelpInfo


    File Added: DifferencesToNpp470_StreamUnComment_BugFix_fls080112.zip

  • FLS

    This patch series is very much outdated and can be closed!!

  • Don HO
    Don HO

    • status: open --> closed
    • Group: --> Next_major_release