Skip to content

Commit

Permalink
fix(previewer): fix extra new line at bottom of buffer previewer (#692)
Browse files Browse the repository at this point in the history
fix(exec): prioritize executables nvim/fzf for windows (#692)
  • Loading branch information
linrongbin16 authored May 9, 2024
1 parent dfb8bc1 commit 6469fe1
Show file tree
Hide file tree
Showing 13 changed files with 55 additions and 906 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ jobs:
ls -l .
echo "run luacov"
luacov -r lcov
luacov
echo "ls ."
ls -l .
echo "tail ./luacov.report.out"
Expand Down
8 changes: 2 additions & 6 deletions lua/fzfx/commons/fileio.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
local uv = vim.uv or vim.loop

local M = {}

-- FileLineReader {
Expand All @@ -15,7 +17,6 @@ local FileLineReader = {}
--- @param batchsize integer?
--- @return commons.FileLineReader?
function FileLineReader:open(filename, batchsize)
local uv = require("fzfx.commons.uv")
local handler = uv.fs_open(filename, "r", 438) --[[@as integer]]
if type(handler) ~= "number" then
error(
Expand Down Expand Up @@ -54,7 +55,6 @@ end
--- @private
--- @return integer
function FileLineReader:_read_chunk()
local uv = require("fzfx.commons.uv")
local chunksize = (self.filesize >= self.offset + self.batchsize) and self.batchsize
or (self.filesize - self.offset)
if chunksize <= 0 then
Expand Down Expand Up @@ -125,7 +125,6 @@ end

-- Close the file reader.
function FileLineReader:close()
local uv = require("fzfx.commons.uv")
if self.handler then
uv.fs_close(self.handler)
self.handler = nil
Expand Down Expand Up @@ -201,7 +200,6 @@ end
--- @param on_complete fun(data:string?):any
--- @param opts {trim:boolean?}?
M.asyncreadfile = function(filename, on_complete, opts)
local uv = require("fzfx.commons.uv")
opts = opts or { trim = false }
opts.trim = type(opts.trim) == "boolean" and opts.trim or false

Expand Down Expand Up @@ -313,7 +311,6 @@ M.asyncreadlines = function(filename, opts)
end
end

local uv = require("fzfx.commons.uv")
local open_result, open_err = uv.fs_open(filename, "r", 438, function(open_complete_err, fd)
if open_complete_err then
_handle_error(open_complete_err, "fs_open complete")
Expand Down Expand Up @@ -442,7 +439,6 @@ end
--- @param on_complete fun(bytes:integer?):any callback on write complete.
--- 1. `bytes`: written data bytes.
M.asyncwritefile = function(filename, content, on_complete)
local uv = require("fzfx.commons.uv")
uv.fs_open(filename, "w", 438, function(open_err, fd)
if open_err then
error(
Expand Down
3 changes: 1 addition & 2 deletions lua/fzfx/commons/logging.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
local IS_WINDOWS = vim.fn.has("win32") > 0 or vim.fn.has("win64") > 0
local uv = vim.uv or vim.loop

local M = {}

Expand Down Expand Up @@ -322,8 +323,6 @@ end
function Logger:_log(dbg, lvl, msg)
assert(type(lvl) == "number" and LogLevelNames[lvl] ~= nil)

local uv = require("fzfx.commons.uv")

if lvl < self.level then
return
end
Expand Down
287 changes: 0 additions & 287 deletions lua/fzfx/commons/micro-async/init.lua

This file was deleted.

Loading

0 comments on commit 6469fe1

Please sign in to comment.