Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions defaults/copy_mode.lua
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ return {
wezterm.action.CopyMode({ SetSelectionMode = "Cell" }),
wezterm.action_callback(function(_, _)
wezterm.GLOBAL.visual_mode = "Cell"
wezterm.emit("modal.enter", "Visual", window, pane)
wezterm.emit("modal.enter", "visual_mode", window, pane)
end),
}),
pane
Expand All @@ -189,7 +189,7 @@ return {
wezterm.action.CopyMode({ SetSelectionMode = "Line" }),
wezterm.action_callback(function(_, _)
wezterm.GLOBAL.visual_mode = "Line"
wezterm.emit("modal.enter", "Visual", window, pane)
wezterm.emit("modal.enter", "visual_mode", window, pane)
end),
}),
pane
Expand All @@ -214,7 +214,7 @@ return {
wezterm.action.CopyMode({ SetSelectionMode = "Block" }),
wezterm.action_callback(function(_, _)
wezterm.GLOBAL.visual_mode = "Block"
wezterm.emit("modal.enter", "Visual", window, pane)
wezterm.emit("modal.enter", "visual_mode", window, pane)
end),
}),
pane
Expand All @@ -239,7 +239,7 @@ return {
wezterm.action.CopyMode({ SetSelectionMode = "SemanticZone" }),
wezterm.action_callback(function(_, _)
wezterm.GLOBAL.visual_mode = "SemanticZone"
wezterm.emit("modal.enter", "Visual", window, pane)
wezterm.emit("modal.enter", "visual_mode", window, pane)
end),
}),
pane
Expand Down
4 changes: 2 additions & 2 deletions defaults/scroll_mode.lua
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ return {
get_hint_status_text = get_hint_status_text,
key_table = {
-- Cancel the mode by pressing escape
{ key = "Escape", action = modal.exit_mode("Scroll") },
{ key = "c", mods = "CTRL", action = modal.exit_mode("Scroll") },
{ key = "Escape", action = modal.exit_mode("scroll_mode") },
{ key = "c", mods = "CTRL", action = modal.exit_mode("scroll_mode") },

{ key = "UpArrow", action = act.ScrollByLine(-1) },
{ key = "DownArrow", action = act.ScrollByLine(1) },
Expand Down
8 changes: 4 additions & 4 deletions defaults/ui_mode.lua
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ return {
-- Cancel the mode by pressing escape
{
key = "Escape",
action = modal.exit_mode("UI"),
action = modal.exit_mode("ui_mode"),
},
{ key = "c", mods = "CTRL", action = modal.exit_mode("UI") },
{ key = "c", mods = "CTRL", action = modal.exit_mode("ui_mode") },

-- Activate panes
activate_pane_direction("h", "Left", "", "CTRL"),
Expand Down Expand Up @@ -255,7 +255,7 @@ return {
wezterm.action_callback(function(_, pane)
pane:move_to_new_window()
end),
modal.exit_mode("UI"),
modal.exit_mode("ui_mode"),
}),
},
{
Expand All @@ -264,7 +264,7 @@ return {
wezterm.action_callback(function(_, pane)
pane:move_to_new_tab()
end),
modal.exit_mode("UI"),
modal.exit_mode("ui_mode"),
}),
},
-- font size
Expand Down
11 changes: 5 additions & 6 deletions plugin/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,11 @@ local function apply_to_config(config)
local fg_status_color = config.colors.background
local status_text =
require("ui_mode").get_hint_status_text(icons, colors, { bg = config.colors.ansi[2], fg = fg_status_color })

add_mode("UI", require("ui_mode").key_table, status_text)
add_mode("ui_mode", require("ui_mode").key_table, status_text)

status_text =
require("scroll_mode").get_hint_status_text(icons, colors, { bg = config.colors.ansi[7], fg = fg_status_color })
add_mode("Scroll", require("scroll_mode").key_table, status_text)
add_mode("scroll_mode", require("scroll_mode").key_table, status_text)

status_text =
require("copy_mode").get_hint_status_text(icons, colors, { bg = config.colors.ansi[4], fg = fg_status_color })
Expand All @@ -222,7 +221,7 @@ local function apply_to_config(config)

status_text =
require("visual_mode").get_hint_status_text(icons, colors, { bg = config.colors.ansi[3], fg = fg_status_color })
add_mode("Visual", {}, status_text)
add_mode("visual_mode", {}, status_text)

config.key_tables = key_tables
end
Expand All @@ -234,12 +233,12 @@ local function set_default_keys(config)
table.insert(config.keys, {
key = "n",
mods = "ALT",
action = activate_mode("Scroll"),
action = activate_mode("scroll_mode"),
})
table.insert(config.keys, {
key = "u",
mods = "ALT",
action = activate_mode("UI"),
action = activate_mode("ui_mode"),
})
table.insert(config.keys, {
key = "c",
Expand Down