MCPcopy Create free account
hub / github.com/ProgerXP/Notepad2e / EditSetNewText

Function EditSetNewText

src/Edit.c:284–307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

282extern FILEVARS fvCurFile;
283
284void EditSetNewText ( HWND hwnd, char *lpstrText, DWORD cbText )
285{
286 bFreezeAppTitle = TRUE;
287 if ( SendMessage ( hwnd, SCI_GETREADONLY, 0, 0 ) ) {
288 SendMessage ( hwnd, SCI_SETREADONLY, FALSE, 0 );
289 }
290 SendMessage ( hwnd, SCI_CANCEL, 0, 0 );
291 SendMessage ( hwnd, SCI_SETUNDOCOLLECTION, 0, 0 );
292 SendMessage ( hwnd, SCI_EMPTYUNDOBUFFER, 0, 0 );
293 SendMessage ( hwnd, SCI_CLEARALL, 0, 0 );
294 SendMessage ( hwnd, SCI_MARKERDELETEALL, ( WPARAM ) - 1, 0 );
295 SendMessage ( hwnd, SCI_SETSCROLLWIDTH, 2048, 0 );
296 SendMessage ( hwnd, SCI_SETXOFFSET, 0, 0 );
297 FileVars_Apply ( hwnd, &fvCurFile );
298 if ( cbText > 0 ) {
299 SendMessage ( hwnd, SCI_ADDTEXT, cbText, ( LPARAM ) lpstrText );
300 }
301 SendMessage ( hwnd, SCI_SETUNDOCOLLECTION, 1, 0 );
302 SendMessage ( hwnd, EM_EMPTYUNDOBUFFER, 0, 0 );
303 SendMessage ( hwnd, SCI_SETSAVEPOINT, 0, 0 );
304 SendMessage ( hwnd, SCI_GOTOPOS, 0, 0 );
305 SendMessage ( hwnd, SCI_CHOOSECARETX, 0, 0 );
306 bFreezeAppTitle = FALSE;
307}
308
309
310//=============================================================================

Callers 2

EditLoadFileFunction · 0.85
_FileLoadFunction · 0.85

Calls 1

FileVars_ApplyFunction · 0.85

Tested by

no test coverage detected