예제 #1
0
  void OnBufferActivated( SCNotification *notifyCode )
  {
    auto loadedBplist = g_pLoadedBplists->find( notifyCode->nmhdr.idFrom );

    if ( loadedBplist == g_pLoadedBplists->end() )
    {
      // Get the current scintilla

      HWND hSkilla;
      CharVt rawBuff = ReadFromSkintilla( hSkilla );

      // not a bplist file
      if ( !IsValidBplist( rawBuff ) )
      {
        return;
      }

      PlistEntryPtr plistEntry = MAKE_PLIST_PTR();

      // get converted text to display
      auto XMLVt = plistEntry->GetXML( std::move( rawBuff ) );
      InsertDataIntoSkilla( hSkilla, XMLVt.data(), XMLVt.size() );

      g_pLoadedBplists->insert( std::make_pair( notifyCode->nmhdr.idFrom, std::move( plistEntry ) ) );

      MarkDocumentIsUnmodified( hSkilla );
    }
  }
예제 #2
0
  void OnBufferActivated( SCNotification *notifyCode )
  {
    int which = -1;
    ::SendMessage(nppData._nppHandle, NPPM_GETCURRENTSCINTILLA, 0, (LPARAM)&which);
    if (which == -1)
      return;
    HWND hCurrentEditView = (which == 0) ? nppData._scintillaMainHandle : nppData._scintillaSecondHandle;




    int cbText = ::SendMessage(hCurrentEditView, SCI_GETLENGTH, NULL, NULL);

    auto loadedBplist = g_pLoadedBplists->find( notifyCode->nmhdr.idFrom );

    if ( loadedBplist == g_pLoadedBplists->end() )
    {
      // Get the current scintilla

      HWND hSkilla;
      CharVt rawBuff = ReadFromSkintilla( hSkilla );

      // not a bplist file
      if ( !IsValidBplist( rawBuff ) )
      {
        return;
      }

      PlistEntryPtr plistEntry = MAKE_PLIST_PTR();

      // get converted text to display
      auto XMLVt = plistEntry->GetXML( std::move( rawBuff ) );
      InsertDataIntoSkilla( hSkilla, XMLVt.data(), XMLVt.size() );

      g_pLoadedBplists->insert( std::make_pair( notifyCode->nmhdr.idFrom, std::move( plistEntry ) ) );

      MarkDocumentIsUnmodified( hSkilla );
    }
  }