Add to recent file history only if file is removed from all the views#2665
Add to recent file history only if file is removed from all the views#2665SinghRajenM wants to merge 1 commit intonotepad-plus-plus:masterfrom
Conversation
PowerEditor/src/NppIO.cpp
Outdated
| // Add to recent file history only if file is removed from all the views | ||
| // There might be cases when file is cloned/moved to view. | ||
| // Don't add to recent list unless file is removed from all the views | ||
| generic_string fileFullPath(TEXT("")); |
There was a problem hiding this comment.
The declaration of variable should be more near as possible to the first usage of variable.
There was a problem hiding this comment.
Variable is declared here because full file path is copied into it in the next if block.
So one way to do so is moving the complete if block just before closing the file [step: bool isBufRemoved = removeBufferFromView(id, whichOne);], because after it we may not get file name as buffer will be removed from view. But still it will be far from the actual use of variable.
Intentionally, I didn't do as code review become easier. Let me know if it is ok to move the complete if block.
There was a problem hiding this comment.
OK, I didn't see it's used in another block. In this case, you're right.
OTOH, you don't need to do generic_string fileFullPath(TEXT(""));
generic_string fileFullPath; will create an empty string.
There was a problem hiding this comment.
Done! used generic_string fileFullPath;
PowerEditor/src/NppIO.cpp
Outdated
|
|
||
| if (PathFileExists(buf->getFullPathName())) | ||
| _lastRecentFileList.add(buf->getFullPathName()); | ||
| fileFullPath += buf->getFullPathName(); |
There was a problem hiding this comment.
Rather fileFullPath = buf->getFullPathName(); IMO
There was a problem hiding this comment.
It should be not be an issue as variable is declared with empty string. Let me know if it really needs to be changed.
There was a problem hiding this comment.
true, but it's rather a sementic issue:
+= is a concatanate operation, that's make us think there's already a string in it and we want to keep it.
So yes, please change it to make the intention more clear.
|
Hello @SinghRajenM, Great work. 👍 Thank you very much. I do appreciate it. Hello @donho, Thank you for reviewing and accepting it. Best regards. |
There might be cases when file is cloned/moved to view. Don't add to recent list unless file is removed from all the views
cbe5f82 to
e7e8b4e
Compare
* Simplify determination of URL at click location Closes notepad-plus-plus#1248, Closes notepad-plus-plus#1255, Closes notepad-plus-plus#1595, Closes notepad-plus-plus#1762, Closes notepad-plus-plus#1768, Closes notepad-plus-plus#2583 * Get back Find dialog while you lost it In the environment of multi-monitor with a laptop + a stantion, it happens all the time that users have lost Find dialog after detaching and retatching - the solution: Ctrl-F twice will get back your Find dialog. * Add to recent file history only if file is removed from all the views There might be cases when file is cloned/moved to view. Don't add to recent list unless file is removed from all the views Closes notepad-plus-plus#2665, Fixes notepad-plus-plus#2277 * Fix the problem of launch Notepad++ with Admin right after installation. Launch N++ with same privileges as explorer FIxes notepad-plus-plus#2641, fixes notepad-plus-plus#159, fixes notepad-plus-plus#556, closes notepad-plus-plus#2643 * Add MD5 functionalities * Notepad++ v7.3 release * Fix "Don't check at launch time" not working problem Preferences... -> Recent Files History -> Don't check at launch time does not work anymore. If it is unchecked, it will be checked again on next Notepad++ launch time. Fixes notepad-plus-plus#2746 * Fix geneation of MD5 on Unicode bug "Geneate MD5 fom text dialog" has geneated wrong result on non ANSI character (Unicode text). This bug is due to wong input data. Fixes notepad-plus-plus#2743 * Add some functions for future use * Fix the shadow declarations & make VS2015 compile again * Fix VS 2015 post build error * Enhancement of "Word characters list" While double-clicking to select or searching with "Match whole word only" option, the selected characters stop on non-word characters. With this enhancement, users can include any non-word character into word characters list, to change its default behaviour. * Update 3 translations * Fix an issue due to VS2015 compiling result (bug) * Add new language Breton * Update chineseSimplified.xml Closes notepad-plus-plus#2748 * Add some missing AutoIt keywords Closes notepad-plus-plus#2728 * Update german.xml to 7.3.1 Including the suggestion notepad-plus-plus#2737 from notepad-plus-plus#2737 Closes notepad-plus-plus#2741 * Update bulgarian.xml Closes notepad-plus-plus#2751 * Improve Folder Browse And Save Dialog Enable the new user interface for "Folder Browse Dialog" including the edit box and enable Vista style for "Save Dialog". Closes notepad-plus-plus#2631 * Fix warning display for Word char list bug * Notepad++ v7.3.1 release * Add Plugins Administrator (UI part, in progress) * Make VS2015 compile again * update japanese.xml to v7.3.1 Closes notepad-plus-plus#2697 * Update ukrainian.xml to v7.3.1 Closes notepad-plus-plus#2787 * Update italian to v7.3.1 Update italian translation according to version 7.3.1 (MD5 tool & Customization of Word char set) Closes notepad-plus-plus#2745 * Hungarian translation update for 7.3.1 Closes notepad-plus-plus#2742 * Language VHDL updated Reserved keyword from IEEE 1076-2008 LRM §15.10 Closes notepad-plus-plus#2659 * Update danish.xml to 7.3.1 Closes notepad-plus-plus#2810 * Enable Scintilla Lexer SCLEX_BAAN (BaanC Language) Closes notepad-plus-plus#2696 * Fix the regression in settings Closes notepad-plus-plus#2814 * FunctionList Update 2 * Implemented XML Schema for functionList.xml. * functionList.xml: 1. new layout of association map; 2. placed `displayName` before `id` attribute where applicable; 3. utilize inline comments; 4. parsers added: 'XML for FunctionList', Assembly, AutoIt3, InnoSetup, PowerShell, KRL, Sinumerik and UniVerse BASIC; 5. parsers improved: C, Java, Batch, Bash, XML and NSIS; 6. replaced `[\t\x20]` with `\h` where possible; 7. using upper case notation for hexadecimal values e.g. `\x7F-\xFF`; Closes notepad-plus-plus#2602 * Go to correct position after word completion Closes notepad-plus-plus#2675, Closes notepad-plus-plus#2802
* Simplify determination of URL at click location Closes notepad-plus-plus#1248, Closes notepad-plus-plus#1255, Closes notepad-plus-plus#1595, Closes notepad-plus-plus#1762, Closes notepad-plus-plus#1768, Closes notepad-plus-plus#2583 * Get back Find dialog while you lost it In the environment of multi-monitor with a laptop + a stantion, it happens all the time that users have lost Find dialog after detaching and retatching - the solution: Ctrl-F twice will get back your Find dialog. * Add to recent file history only if file is removed from all the views There might be cases when file is cloned/moved to view. Don't add to recent list unless file is removed from all the views Closes notepad-plus-plus#2665, Fixes notepad-plus-plus#2277 * Fix the problem of launch Notepad++ with Admin right after installation. Launch N++ with same privileges as explorer FIxes notepad-plus-plus#2641, fixes notepad-plus-plus#159, fixes notepad-plus-plus#556, closes notepad-plus-plus#2643 * Add MD5 functionalities * Notepad++ v7.3 release * Fix "Don't check at launch time" not working problem Preferences... -> Recent Files History -> Don't check at launch time does not work anymore. If it is unchecked, it will be checked again on next Notepad++ launch time. Fixes notepad-plus-plus#2746 * Fix geneation of MD5 on Unicode bug "Geneate MD5 fom text dialog" has geneated wrong result on non ANSI character (Unicode text). This bug is due to wong input data. Fixes notepad-plus-plus#2743 * Add some functions for future use * Fix the shadow declarations & make VS2015 compile again * Fix VS 2015 post build error * Enhancement of "Word characters list" While double-clicking to select or searching with "Match whole word only" option, the selected characters stop on non-word characters. With this enhancement, users can include any non-word character into word characters list, to change its default behaviour. * Update 3 translations * Fix an issue due to VS2015 compiling result (bug) * Add new language Breton * Update chineseSimplified.xml Closes notepad-plus-plus#2748 * Add some missing AutoIt keywords Closes notepad-plus-plus#2728 * Update german.xml to 7.3.1 Including the suggestion notepad-plus-plus#2737 from notepad-plus-plus#2737 Closes notepad-plus-plus#2741 * Update bulgarian.xml Closes notepad-plus-plus#2751 * Improve Folder Browse And Save Dialog Enable the new user interface for "Folder Browse Dialog" including the edit box and enable Vista style for "Save Dialog". Closes notepad-plus-plus#2631 * Fix warning display for Word char list bug * Notepad++ v7.3.1 release * Add Plugins Administrator (UI part, in progress) * Make VS2015 compile again * update japanese.xml to v7.3.1 Closes notepad-plus-plus#2697 * Update ukrainian.xml to v7.3.1 Closes notepad-plus-plus#2787 * Update italian to v7.3.1 Update italian translation according to version 7.3.1 (MD5 tool & Customization of Word char set) Closes notepad-plus-plus#2745 * Hungarian translation update for 7.3.1 Closes notepad-plus-plus#2742 * Language VHDL updated Reserved keyword from IEEE 1076-2008 LRM §15.10 Closes notepad-plus-plus#2659 * Update danish.xml to 7.3.1 Closes notepad-plus-plus#2810 * Enable Scintilla Lexer SCLEX_BAAN (BaanC Language) Closes notepad-plus-plus#2696 * Fix the regression in settings Closes notepad-plus-plus#2814 * FunctionList Update 2 * Implemented XML Schema for functionList.xml. * functionList.xml: 1. new layout of association map; 2. placed `displayName` before `id` attribute where applicable; 3. utilize inline comments; 4. parsers added: 'XML for FunctionList', Assembly, AutoIt3, InnoSetup, PowerShell, KRL, Sinumerik and UniVerse BASIC; 5. parsers improved: C, Java, Batch, Bash, XML and NSIS; 6. replaced `[\t\x20]` with `\h` where possible; 7. using upper case notation for hexadecimal values e.g. `\x7F-\xFF`; Closes notepad-plus-plus#2602 * Go to correct position after word completion Closes notepad-plus-plus#2675, Closes notepad-plus-plus#2802
There might be cases when file is cloned/moved to view. Don't add to recent list unless file is removed from all the views Closes notepad-plus-plus#2665, Fixes notepad-plus-plus#2277
Fixed issue: #2277
There might be cases when file is cloned/moved to view. Don't add to recent list unless file is removed from all the views.