>> The TAB width should be consistent for all listings in a document. You >> are right, that some prefer 3 characters, some 4, some only 2. So what >> we need is an item in the listings dialog in the document settings. 4 >> should be the default. >> The current 8 characters width is definitively too wide to get >> readable documents. > >I do not understand, are you guys talking about screen display, tab -> space >translation, or listings output of tab? >Lyx can display tab in whatever way >it wants (4 spaces I guess) as long as tabs are outputted to latex so that >listings can handle them correctly. >
I think it is about how LyX displays the tabs. Now, the tabs are painted by QPainter and the cursor movement is guided by QFontMetrics. I tried to paint the tabs and to guide the cursor myself, but this lead to (for me) ununderstandable crashes. If you know how we can override the default of 8 spaces, let me know. Second, if the user specifies a certain tab width for the output in listings, then it would also be nice that the same tab width is used on the screen. This means we have to pass this info to the (rather low-level) painting and cursor movement code. May it be an option to create an InsetTab or something, which can easily be specified a certain width and can be drawn in a customized way ? Vincent