Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kakoune: update ui options #3396

Closed
wants to merge 1 commit into from
Closed
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
64 changes: 34 additions & 30 deletions modules/programs/kakoune.nix
Original file line number Diff line number Diff line change
Expand Up @@ -268,52 +268,49 @@ let
'';
};

changeColors = mkOption {
type = types.bool;
default = true;
description = ''
Change color palette.
'';
};

wheelDownButton = mkOption {
type = types.nullOr types.str;
shiftFunctionKeys = mkOption {
type = types.nullOr types.ints.unsigned;
default = null;
description = ''
Button to send for wheel down events.
Amount by which shifted function keys are offset. That
is, if the terminal sends F13 for Shift-F1, this
should be <literal>12</literal>.
'';
};

wheelUpButton = mkOption {
paddingChar = mkOption {
type = types.nullOr types.str;
default = null;
description = ''
Button to send for wheel up events.
Set the character used to indicate the area out of the displayed buffer.
The kakoune default is <literal>"~"</literal>.
'';
};

shiftFunctionKeys = mkOption {
type = types.nullOr types.ints.unsigned;
default = null;
paddingFill = mkOption {
type = types.bool;
default = false;
description = ''
Amount by which shifted function keys are offset. That
is, if the terminal sends F13 for Shift-F1, this
should be <literal>12</literal>.
Whether to fill the padding area with the padding
character instead of displaying a single character
at the beginning of the padding line.
'';
};

useBuiltinKeyParser = mkOption {
synchronized = mkOption {
type = types.bool;
default = false;
description = ''
Bypass ncurses key parser and use an internal one.
Whether to emit synchronized output escape sequences
and reduce terminal output with sequences that could
trigger flickering if unsynchronized.
'';
};
};
});
default = null;
description = ''
Settings for the ncurses interface.
Settings for the terminal interface.
'';
};

Expand Down Expand Up @@ -536,16 +533,12 @@ let
}"
"terminal_assistant=${assistant}"
"terminal_enable_mouse=${if enableMouse then "true" else "false"}"
"terminal_change_colors=${if changeColors then "true" else "false"}"
"${optionalString (wheelDownButton != null)
"terminal_wheel_down_button=${wheelDownButton}"}"
"${optionalString (wheelUpButton != null)
"terminal_wheel_up_button=${wheelUpButton}"}"
"${optionalString (shiftFunctionKeys != null)
"terminal_shift_function_key=${toString shiftFunctionKeys}"}"
"terminal_builtin_key_parser=${
if useBuiltinKeyParser then "true" else "false"
}"
"${optionalString (paddingChar != null)
"terminal_padding_char=${paddingChar}"}"
"terminal_padding_fill=${if paddingFill then "true" else "false"}"
"terminal_synchronized=${if synchronized then "true" else "false"}"
];

userModeString = mode:
Expand Down Expand Up @@ -620,6 +613,17 @@ let
(optionalString (cfg.config != null) cfgStr + "\n" + cfg.extraConfig);

in {
imports = let
mkRemovedOptionUI = option:
(mkRemovedOptionModule [ "programs" "kakoune" "config" "ui" option ]
"Kakoune dropped ncurses so this option has been removed.");
in map mkRemovedOptionUI [
"changeColors"
"wheelDownButton"
"wheelUpButton"
"useBuiltinKeyParser"
];

options = {
programs.kakoune = {
enable = mkEnableOption "the kakoune text editor";
Expand Down