From e47dd1d7657fc2ff863a69e3ea2623fa26962b8c Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 30 Jul 2024 12:42:12 +0200 Subject: [PATCH] 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 --- src/plugins/fakevim/fakevimactions.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/fakevim/fakevimactions.cpp b/src/plugins/fakevim/fakevimactions.cpp index 35cdce0bafb..1146ac894b4 100644 --- a/src/plugins/fakevim/fakevimactions.cpp +++ b/src/plugins/fakevim/fakevimactions.cpp @@ -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);