Giter Site home page Giter Site logo

Comments (3)

krobelus avatar krobelus commented on May 25, 2024

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.

from kakoune.

sdothum avatar sdothum commented on May 25, 2024

Here is the requested debug output..

*** 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.

from kakoune.

krobelus avatar krobelus commented on May 25, 2024

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.

from kakoune.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.