A Neovim plugin enabling you to solve LeetCode problems.
docs: fix typo
5 files changed, +5 -7
+1-1README.md
| @@ -244,7 +244,7 @@ Inject code before or after your solution, injected code won't be submitted or r | ||
| 244 | 244 | You can also pass `before = true` to inject default imports for the language. |
| 245 | 245 | Supported languages are `python`, `python3`, `java` |
| 246 | 246 | |
| 247 | -Access default imports via `require("leetcode.config.imports)` | |
| 247 | +Access default imports via `require("leetcode.config.imports")` | |
| 248 | 248 | |
| 249 | 249 | ```lua |
| 250 | 250 | injector = { ---@type table<lc.lang, lc.inject> |
+1-1README.zh.md
| @@ -246,7 +246,7 @@ logging = true | ||
| 246 | 246 | 您还可以传递 `before = true` 以注入语言的默认导入。 |
| 247 | 247 | 支持的语言为 `python`、`python3`、`java` |
| 248 | 248 | |
| 249 | -通过 `require("leetcode.config.imports)` 访问默认导入 | |
| 249 | +通过 `require("leetcode.config.imports")` 访问默认导入 | |
| 250 | 250 | |
| 251 | 251 | ```lua |
| 252 | 252 | injector = { ---@type table<lc.lang, lc.inject> |
+2-3lua/leetcode-ui/question.lua
| @@ -69,11 +69,10 @@ function Question:path() | ||
| 69 | 69 | |
| 70 | 70 | local fn = ("%s.%s%s.%s"):format(self.q.frontend_id, self.q.title_slug, alt, lang.ft) |
| 71 | 71 | self.file = config.storage.home:joinpath(fn) |
| 72 | - local existed = true | |
| 72 | + local existed = self.file:exists() | |
| 73 | 73 | |
| 74 | - if not self.file:exists() then -- | |
| 74 | + if not existed then -- | |
| 75 | 75 | self.file:write(self:snippet(), "w") |
| 76 | - existed = false | |
| 77 | 76 | end |
| 78 | 77 | |
| 79 | 78 | return self.file:absolute(), existed |
+0-1lua/leetcode/config/imports.lua
| @@ -51,7 +51,6 @@ imports["python"] = { | ||
| 51 | 51 | "from itertools import *", |
| 52 | 52 | "from functools import *", |
| 53 | 53 | "from operator import *", |
| 54 | - "from __builtin__ import *", | |
| 55 | 54 | "import string", |
| 56 | 55 | "import re", |
| 57 | 56 | "import datetime", |