From b2a99264f4d197ba618b7f0bb0c76c4bd0cf8c30 Mon Sep 17 00:00:00 2001 From: donho Date: Sat, 28 Jun 2008 00:41:46 +0000 Subject: [PATCH] [BUG_FIXED] improve the recognition of tag name. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@261 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/bin/change.log | 41 ++++++++++++++++---------------- PowerEditor/src/Notepad_plus.cpp | 10 ++++++-- 2 files changed, 29 insertions(+), 22 deletions(-) diff --git a/PowerEditor/bin/change.log b/PowerEditor/bin/change.log index a920904d..8b0ed1f1 100644 --- a/PowerEditor/bin/change.log +++ b/PowerEditor/bin/change.log @@ -1,26 +1,27 @@ -Notepad++ v5 Beta fixed bugs and added features (from v4.9.2) : +Notepad++ v5 fixed bugs and added features (from v4.9.2) : 1. Improve Notepad++ performance - on startup and on exit. 2. Add Calltip capacity. -3. All the menu commands can be added in context menu, including plugins' commands, macros and user defined commands. -4. Add bookmarked lines operations : delete all marked lines, copy all marked lines into clipboard, cut all marked lines into clipboard, paste from clipboard to replace all marked lines content. -5. Fix crash bug : Open files with date pre-1970. -6. Fix clone mode bug : now the actions done in one view will be synchronized in the cloned view. -7. Add tooltips in document tab to display the full file name path. -8. Change hide lines behaviour : Hide lines now saved during switches. -9. Change file history list behaviour : Most recent closed file is on the top. Add number on list. -10. Caret width and blink rate are customizable. -11. Add asterisk in title bar if file is dirty. -12. The bookmarks' look & feel are improved. -13. Add "Select all" and "copy" context menu items in Find in files results window. -14. Fix goto line with command line bug. -15. Improve smart highlight / mark all / incremental search highlight all visibility -16. Tabbar's coulours is configurable via Stylers Configurator(Active tab Text, Inactive tab text, Inactive tab background, Active tab focused indicator and Active tab unfocused indicator). -17. Add the smart highlight file size limit - 1.5 MB in order to improve the performance. -18. Add exception handling (dumping filedata). -19. Fix go to line command line bug. -20. Enhance Find in files and Find in all opened files features' performance. -21. Fix dialog off screen problem under multi-monitor environment. +3. Add HTML/XML tag match highlighting. +4. All the menu commands can be added in context menu, including plugins' commands, macros and user defined commands. +5. Add bookmarked lines operations : delete all marked lines, copy all marked lines into clipboard, cut all marked lines into clipboard, paste from clipboard to replace all marked lines content. +6. Fix crash bug : Open files with date pre-1970. +7. Fix clone mode bug : now the actions done in one view will be synchronized in the cloned view. +8. Add tooltips in document tab to display the full file name path. +9. Change hide lines behaviour : Hide lines now saved during switches. +10. Change file history list behaviour : Most recent closed file is on the top. Add number on list. +11. Caret width and blink rate are customizable. +12. Add asterisk in title bar if file is dirty. +13. The bookmarks' look & feel are improved. +14. Add "Select all" and "copy" context menu items in Find in files results window. +15. Fix goto line with command line bug. +16. Improve smart highlight / mark all / incremental search highlight all visibility +17. Tabbar's coulours is configurable via Stylers Configurator(Active tab Text, Inactive tab text, Inactive tab background, Active tab focused indicator and Active tab unfocused indicator). +18. Add the smart highlight file size limit - 1.5 MB in order to improve the performance. +19. Add exception handling (dumping filedata). +20. Fix go to line command line bug. +21. Enhance Find in files and Find in all opened files features' performance. +22. Fix dialog off screen problem under multi-monitor environment. Included plugins : diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index ddc78846..d0b67d7c 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -2181,7 +2181,6 @@ BOOL Notepad_plus::notify(SCNotification *notification) break; } - case SCN_HOTSPOTDOUBLECLICK : { notifyView->execute(SCI_SETWORDCHARS, 0, (LPARAM)"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-+.:?&@=/%#"); @@ -2389,12 +2388,16 @@ bool Notepad_plus::getXmlMatchedTagsPos(XmlMatchedTagsPos & tagsPos) // determinate the nature of current word : tagOpen, tagClose or outOfTag TagCateg tagCateg = getTagCategory(tagsPos, caretPos); + static const char tagNameChars[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_:"; + switch (tagCateg) { case tagOpen : // if tagOpen search right { + _pEditView->execute(SCI_SETWORDCHARS, 0, (LPARAM)tagNameChars); int startPos = _pEditView->execute(SCI_WORDSTARTPOSITION, tagsPos.tagOpenStart+1, true); int endPos = _pEditView->execute(SCI_WORDENDPOSITION, tagsPos.tagOpenStart+1, true); + _pEditView->execute(SCI_SETCHARSDEFAULT); char * tagName = new char[endPos-startPos+1]; _pEditView->getText(tagName, startPos, endPos); @@ -2432,8 +2435,11 @@ bool Notepad_plus::getXmlMatchedTagsPos(XmlMatchedTagsPos & tagsPos) case tagClose : // if tagClose search left { + _pEditView->execute(SCI_SETWORDCHARS, 0, (LPARAM)tagNameChars); int startPos = _pEditView->execute(SCI_WORDSTARTPOSITION, tagsPos.tagCloseStart+2, true); int endPos = _pEditView->execute(SCI_WORDENDPOSITION, tagsPos.tagCloseStart+2, true); + _pEditView->execute(SCI_SETCHARSDEFAULT); + char * tagName = new char[endPos-startPos+1]; _pEditView->getText(tagName, startPos, endPos); @@ -2465,7 +2471,7 @@ bool Notepad_plus::getXmlMatchedTagsPos(XmlMatchedTagsPos & tagsPos) return true; caretPos = foundPos.first; - } + } return false; }