39
39
*
40
40
* TODO:
41
41
* - Add a way to set the 16 ANSI colors, to be used for 'termguicolors' and in
42
- * the GUI.
42
+ * the GUI. #2747
43
43
* - Win32: Make terminal used for :!cmd in the GUI work better. Allow for
44
44
* redirection. Probably in call to channel_set_pipes().
45
45
* - implement term_setsize()
46
46
* - Copy text in the vterm to the Vim buffer once in a while, so that
47
47
* completion works.
48
- * - Adding WinBar to terminal window doesn't display, text isn't shifted down.
49
- * a job that uses 16 colors while Vim is using > 256.
50
48
* - in GUI vertical split causes problems. Cursor is flickering. (Hirohito
51
49
* Higashi, 2017 Sep 19)
52
50
* - after resizing windows overlap. (Boris Staletic, #2164)
@@ -3329,6 +3327,26 @@ static VTermParserCallbacks parser_fallbacks = {
3329
3327
NULL /* resize */
3330
3328
};
3331
3329
3330
+ /*
3331
+ * Use Vim's allocation functions for vterm so profiling works.
3332
+ */
3333
+ static void *
3334
+ vterm_malloc (size_t size , void * data UNUSED )
3335
+ {
3336
+ return alloc_clear (size );
3337
+ }
3338
+
3339
+ static void
3340
+ vterm_memfree (void * ptr , void * data UNUSED )
3341
+ {
3342
+ vim_free (ptr );
3343
+ }
3344
+
3345
+ static VTermAllocatorFunctions vterm_allocator = {
3346
+ & vterm_malloc ,
3347
+ & vterm_memfree
3348
+ };
3349
+
3332
3350
/*
3333
3351
* Create a new vterm and initialize it.
3334
3352
*/
@@ -3340,7 +3358,7 @@ create_vterm(term_T *term, int rows, int cols)
3340
3358
VTermState * state ;
3341
3359
VTermValue value ;
3342
3360
3343
- vterm = vterm_new (rows , cols );
3361
+ vterm = vterm_new_with_allocator (rows , cols , & vterm_allocator , NULL );
3344
3362
term -> tl_vterm = vterm ;
3345
3363
screen = vterm_obtain_screen (vterm );
3346
3364
vterm_screen_set_callbacks (screen , & screen_callbacks , term );
0 commit comments