Hi,
I've stumbled across something in main.c/ui.c that looks a bit fishy
whilst trying to figure out how and when the variables "Rows" and
"Columns" are initialized.
In "main()", "ui_get_shellsize()" is called to "Set the default values
for the options that use Rows and Columns". This function checks
"gui.in_use" to determine whether to call "gui_get_shellsize()" or
"mch_set_shellsize()". However, at this point "gui.in_use" has not
been initialized and will always be "FALSE" (it is initialized later
in "main()" when "gui_init()" is called) so if the GUI is starting the
incorrect function is called.
It seems other GUIs are working around this bug(?) with #ifdef's here
and there to initialize "Rows" and "Columns", but wouldn't it be
better to solve this by changing "ui_get_shellsize()" to check for
"gui.in_use || gui.starting" instead? Something like:
int
ui_get_shellsize()
{
int retval;
#ifdef FEAT_GUI
if (gui.in_use || gui.starting)
retval = gui_get_shellsize();
else
#endif
retval = mch_get_shellsize();
This problem does not seem to affect the other functions in ui.c that
check "gui.in_use" since they are not call this early in the
initialization (as far as I can tell). This change may affect the
initializations of the other GUIs, hence this post is formulated as a
questions instead of me posting a patch.
Björn
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---