Skip to content

Commit

Permalink
Remove optional dependency on options.nvim
Browse files Browse the repository at this point in the history
  • Loading branch information
Furkanzmc committed Apr 5, 2024
1 parent dc9ff5d commit d4b8c5a
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 42 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ See the documentation for more details.

# Installation

Install using your favorite plugin manager. There's no required dependencies. Optionally, you can
install [option.nvim](https://github.com/furkanzmc/options.nvim) for customization. If it's not
installed, you'll see a warning but you can ignore it.
Install using your favorite plugin manager. There's no required dependencies.

# Example Use Cases

Expand Down
13 changes: 0 additions & 13 deletions doc/firvish.txt
Original file line number Diff line number Diff line change
Expand Up @@ -220,19 +220,6 @@ Deletes the buffers in [range]. If <bang> is given, the command is equivalent to
|:bdelete!|.


OPTIONS *firvish-options*
================================================================================

These options are only enabled if |options.nvim| is installed.
See https://github.com/Furkanzmc/options.nvim for installation details.

Global ~

alwayspreview *firvish-options-alwayspreview*

When set to true, the output of the running job will be shown in
|previewwindow|. Defaults to `false`.

MAPPINGS *firvish-mappings*
================================================================================

Expand Down
2 changes: 0 additions & 2 deletions doc/tags
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ firvish-about firvish.txt /*firvish-about*
firvish-commands firvish.txt /*firvish-commands*
firvish-lua firvish.txt /*firvish-lua*
firvish-mappings firvish.txt /*firvish-mappings*
firvish-options firvish.txt /*firvish-options*
firvish-options-alwayspreview firvish.txt /*firvish-options-alwayspreview*
firvish.job_control.start_job firvish.txt /*firvish.job_control.start_job*
firvish.notifications.notify firvish.txt /*firvish.notifications.notify*
firvish.nvim firvish.txt /*firvish.nvim*
Expand Down
16 changes: 0 additions & 16 deletions lua/firvish.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,6 @@ local utils = require("firvish.utils")
local log = require("firvish.log")
local M = {}

local options_loaded, options = pcall(require, "options")
if not options_loaded then
log.warning("options.nvim is not installed. See `:help firvish.txt` for disabled features.")
end

if options_loaded then
options.register_option({
name = "alwayspreview",
type_info = "boolean",
description = "When set to true, the output of the running job will be shown in previewwindow.",
default = false,
source = "firvish",
global = true,
})
end

local function run_commands(bufnr, sh_mode)
if sh_mode == true then
local shell = vim.api.nvim_get_var("firvish_shell")
Expand Down
8 changes: 0 additions & 8 deletions lua/firvish/job_control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ local api = vim.api
local utils = require("firvish.utils")
local log = require("firvish.log")
local notifications = require("firvish.notifications")
local options_loaded, options = pcall(require, "options")

local s_jobs = {}
local s_job_count = 1
Expand Down Expand Up @@ -405,13 +404,6 @@ M.start_job = function(opts)
end

M.refresh_job_list_window()
if
(s_job_list_bufnr ~= -1 or s_job_output_preview_bufnr ~= -1)
and options_loaded
and options.get_option_value("alwayspreview") == true
then
M.preview_job_output(job_id)
end
end

M.refresh_job_list_window = function()
Expand Down

0 comments on commit d4b8c5a

Please sign in to comment.