Skip to content

Commit

Permalink
docs: fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
kawre committed Feb 27, 2024
1 parent 14c1de4 commit dde441f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ Inject code before or after your solution, injected code won't be submitted or r
You can also pass `before = true` to inject default imports for the language.
Supported languages are `python`, `python3`, `java`

Access default imports via `require("leetcode.config.imports)`
Access default imports via `require("leetcode.config.imports")`

```lua
injector = { ---@type table<lc.lang, lc.inject>
Expand Down
2 changes: 1 addition & 1 deletion README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ logging = true
您还可以传递 `before = true` 以注入语言的默认导入。
支持的语言为 `python``python3``java`

通过 `require("leetcode.config.imports)` 访问默认导入
通过 `require("leetcode.config.imports")` 访问默认导入

```lua
injector = { ---@type table<lc.lang, lc.inject>
Expand Down
5 changes: 2 additions & 3 deletions lua/leetcode-ui/question.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,10 @@ function Question:path()

local fn = ("%s.%s%s.%s"):format(self.q.frontend_id, self.q.title_slug, alt, lang.ft)
self.file = config.storage.home:joinpath(fn)
local existed = true
local existed = self.file:exists()

if not self.file:exists() then --
if not existed then --
self.file:write(self:snippet(), "w")
existed = false
end

return self.file:absolute(), existed
Expand Down
2 changes: 1 addition & 1 deletion lua/leetcode-ui/renderer/menu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ function Menu:remount()
api.nvim_buf_delete(self.bufnr, { force = true })
end

vim.cmd.tabe()
vim.cmd("$tabnew")
self.bufnr = api.nvim_get_current_buf()
self.winid = api.nvim_get_current_win()

Expand Down
1 change: 0 additions & 1 deletion lua/leetcode/config/imports.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ imports["python"] = {
"from itertools import *",
"from functools import *",
"from operator import *",
"from __builtin__ import *",
"import string",
"import re",
"import datetime",
Expand Down

0 comments on commit dde441f

Please sign in to comment.