Skip to content

Commit

Permalink
kakoune: update ui options
Browse files Browse the repository at this point in the history
  • Loading branch information
lobre committed Dec 29, 2022
1 parent 1ef0da3 commit 23dc634
Showing 1 changed file with 34 additions and 30 deletions.
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 = [
(mkRemovedOptionModule [ "programs" "kakoune" "config" "ui" "changeColors" ]
"Kakoune dropped the dependency to ncurses so this option has been removed.")
(mkRemovedOptionModule [ "programs" "kakoune" "config" "ui" "wheelDownButton" ]
"Kakoune dropped the dependency to ncurses so this option has been removed.")
(mkRemovedOptionModule [ "programs" "kakoune" "config" "ui" "wheelUpButton" ]
"Kakoune dropped the dependency to ncurses so this option has been removed.")
(mkRemovedOptionModule [ "programs" "kakoune" "config" "ui" "useBuiltinKeyParser" ]
"Kakoune dropped the dependency to ncurses so this option has been removed.")
];

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

0 comments on commit 23dc634

Please sign in to comment.