| 727 | |
| 728 | // ReSharper disable once CppInconsistentNaming |
| 729 | extern "C" __declspec(dllexport) void beNotified(SCNotification *notify_code) { |
| 730 | notify(notify_code); |
| 731 | switch (notify_code->nmhdr.code) { |
| 732 | case NPPN_SHUTDOWN: { |
| 733 | print_to_log(L"NPPN_SHUTDOWN", npp->get_editor_hwnd()); |
| 734 | edit_recheck_timer.reset(); |
| 735 | scroll_recheck_timer.reset(); |
| 736 | command_menu_clean_up(); |
| 737 | |
| 738 | plugin_clean_up(); |
| 739 | RemoveWindowSubclass(npp_data.npp_handle, subclass_proc, 0); |
| 740 | } |
| 741 | break; |
| 742 | |
| 743 | case NPPN_READY: { |
| 744 | register_custom_messages(); |
| 745 | init_classes(); |
| 746 | print_to_log(L"NPPN_READY", npp->get_editor_hwnd()); |
| 747 | check_queue.clear(); |
| 748 | create_hooks(); |
| 749 | edit_recheck_timer.emplace(npp_data.npp_handle); |
| 750 | edit_recheck_timer->on_timer_tick.connect(edit_recheck_callback); |
| 751 | scroll_recheck_timer.emplace(npp_data.npp_handle); |
| 752 | scroll_recheck_timer->on_timer_tick.connect(scroll_recheck_callback); |
| 753 | spell_checker->recheck_visible_both_views(); |
| 754 | restyling_caused_recheck_was_done = false; |
| 755 | suggestions_button->set_transparency(); |
| 756 | rearrange_menu(); |
| 757 | } |
| 758 | break; |
| 759 | |
| 760 | case NPPN_BUFFERACTIVATED: { |
| 761 | if (settings) |
| 762 | print_to_log(L"NPPN_BUFFERACTIVATED", npp->get_editor_hwnd()); |
| 763 | if (!spell_checker) |
| 764 | return; |
| 765 | recheck_visible(); |
| 766 | restyling_caused_recheck_was_done = false; |
| 767 | } |
| 768 | break; |
| 769 | |
| 770 | case SCN_FOLDINGSTATECHANGED: |
| 771 | update_on_visible_area_changed(); |
| 772 | break; |
| 773 | |
| 774 | case SCN_UPDATEUI: |
| 775 | if (!spell_checker) |
| 776 | return; |
| 777 | if ((notify_code->updated & SC_UPDATE_CONTENT) != 0 && (!is_any_timer_active() || first_restyle) && !restyling_caused_recheck_was_done) |
| 778 | // If restyling wasn't caused |
| 779 | // by user input... |
| 780 | { |
| 781 | ACTIVE_VIEW_BLOCK(npp_interface()); |
| 782 | spell_checker->recheck_visible(); |
| 783 | if (!first_restyle) |
| 784 | restyling_caused_recheck_was_done = true; |
| 785 | first_restyle = false; |
| 786 | } else if ((notify_code->updated & (SC_UPDATE_V_SCROLL | SC_UPDATE_H_SCROLL)) != 0) // If scroll wasn't caused by user input... |
nothing calls this directly
no test coverage detected