diff options
| author | Thomas Schmucker <ts@its1.de> | 2026-07-24 11:21:33 +0200 |
|---|---|---|
| committer | Thomas Schmucker <ts@its1.de> | 2026-07-24 11:21:33 +0200 |
| commit | e786fedb6f680e84a9bca37cfad7342a06e05a51 (patch) | |
| tree | 3a640111c6928d7f2fab7d98dc6db032e646d388 /nvim/lua | |
| parent | c76dc6075beb1bbbc55231df7d5aa50b5f70ba2c (diff) | |
| download | dotfiles-e786fedb6f680e84a9bca37cfad7342a06e05a51.tar.gz dotfiles-e786fedb6f680e84a9bca37cfad7342a06e05a51.tar.bz2 dotfiles-e786fedb6f680e84a9bca37cfad7342a06e05a51.zip | |
neovim: is_windows-Variable statt has('win32') == 0
Lua-Falle vermieden: 0 ist in Lua truthy, ein direktes
'not vim.fn.has("win32")' waere falsch gewesen. Stattdessen
is_windows = vim.fn.has("win32") == 1 (liefert echtes bool),
dann 'if not is_windows then' - lesbarer als '== 0'.
Diffstat (limited to 'nvim/lua')
| -rw-r--r-- | nvim/lua/config/usercmds.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/nvim/lua/config/usercmds.lua b/nvim/lua/config/usercmds.lua index db02497..529b370 100644 --- a/nvim/lua/config/usercmds.lua +++ b/nvim/lua/config/usercmds.lua | |||
| @@ -69,7 +69,9 @@ end | |||
| 69 | -- sonar-scanner/scripts/sonarqube.sh sind POSIX-only (kein Windows-Pendant), | 69 | -- sonar-scanner/scripts/sonarqube.sh sind POSIX-only (kein Windows-Pendant), |
| 70 | -- deshalb Kommandos unter Windows gar nicht erst registrieren statt sie | 70 | -- deshalb Kommandos unter Windows gar nicht erst registrieren statt sie |
| 71 | -- dort fehlschlagen zu lassen. | 71 | -- dort fehlschlagen zu lassen. |
| 72 | if vim.fn.has("win32") == 0 then | 72 | local is_windows = vim.fn.has("win32") == 1 |
| 73 | |||
| 74 | if not is_windows then | ||
| 73 | vim.api.nvim_create_user_command("SonarScan", run_sonar, {}) | 75 | vim.api.nvim_create_user_command("SonarScan", run_sonar, {}) |
| 74 | vim.api.nvim_create_user_command("SonarIssues", load_sonar_issues, {}) | 76 | vim.api.nvim_create_user_command("SonarIssues", load_sonar_issues, {}) |
| 75 | end | 77 | end |
