FakeVim: Restrict tabstop size

The default minimum of QSpinBox is 0 which is not allowed
for vim's tabstop in general.
It has to be some positive integer.
Beside disallowing the unsupported value it also fixes
some crash which could happen if using the zero as
tabstop width. (div by zero)

Fixes: QTCREATORBUG-28082
Change-Id: I8913b1c28b8ec239ecdf2306fe8861669ccb9d56
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Stenger
2024-07-30 12:42:12 +02:00
parent a8f74a011f
commit e47dd1d765

View File

@@ -114,6 +114,7 @@ FakeVimSettings::FakeVimSettings()
tabStop.setToolTip(Tr::tr("Vim tabstop option."));
#ifndef FAKEVIM_STANDALONE
tabStop.setRange(1, 99);
backspace.setDisplayStyle(FvStringAspect::LineEditDisplay);
isKeyword.setDisplayStyle(FvStringAspect::LineEditDisplay);