You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
comment-line on occasion with shell scripts (whose filetype is set via modeline-prompt) will complain: "the 'commert_line' option is empty, could not comment the line".
Expectations
Comment/uncomment line.
Additional information
comment.kak, while setting the commert_line option to '#' by default, appears to have this unset during buffer loading (perhaps a timing conflict with modeline-prompt?).
The solution was to modify comment.kak. I simply changed the hook for filetype=conf to filetype=(conf|sh)
The text was updated successfully, but these errors were encountered:
there is at least one issue when the filetype is first something like markdown and then sh
Can you reproduce wiht this in your kakrc:
hook global BufSetOption filetype=.* %{
echo -debug setting %val{hook_param}
}
hook global BufSetOption comment_line=.* %{
echo -debug setting %val{hook_param}
}
and post the contents of the debug buffer.
The conf hook is already a hack; ideally resetting the option when a filetype gets unset works for all filetypes, even the empty one.
We have the same problem with some other hooks.
One problem is hook ordering, maybe we should have a hook -first option so "scope end" style hooks run before others.
*** This is the debug buffer, where debug info will be written ***
setting comment_line=
setting filetype=html
setting filetype=sh
setting filetype=sh
setting comment_line=
kak-lsp: config-change detected:
. . .
with the stock comment.kak (without the hook for filetype=sh that i added) opening a script which sets the filetype with modeline-prompt.
i opened this file and attempted to immediately comment the first line.
I'm working on a fix, my current approach is to add a BufSetOptionPre hook so each filetype hook can unset what it did without BufSetOption hooks having to worry.
Version of Kakoune
v2023.08.05
Reproducer
Execute :comment-line on selected lines
Outcome
comment-line on occasion with shell scripts (whose filetype is set via modeline-prompt) will complain: "the 'commert_line' option is empty, could not comment the line".
Expectations
Comment/uncomment line.
Additional information
comment.kak, while setting the commert_line option to '#' by default, appears to have this unset during buffer loading (perhaps a timing conflict with modeline-prompt?).
The solution was to modify comment.kak. I simply changed the hook for filetype=conf to filetype=(conf|sh)
The text was updated successfully, but these errors were encountered: