Git Product home page Git Product logo

Comments (7)

AndrewRadev avatar AndrewRadev commented on August 19, 2024 2

@cheap-glitch I've added customizable mappings in a separate branch for now, because I still have some documentation and testing to do, and I might rethink the code organization, it feels a bit non-obvious to me. The branch is custom-mappings. Could you try it out and let me know if it makes sense to you? Here's where the mappings go in the config: https://github.com/AndrewRadev/quickmd/blob/custom-mappings/res/default_config.yaml#L24-L33

from quickmd.

cheap-glitch avatar cheap-glitch commented on August 19, 2024 1

It's not very vim-like, but I'd love to be able to press q to quit. It would match the behavior of other lightweight "document viewers" that I use (for images, PDFs, etc.)

from quickmd.

AndrewRadev avatar AndrewRadev commented on August 19, 2024 1

Is this an actual bug, or was it removed but the readme wasn't updated?

I've missed it in the README, I'll give it a refresh once I'm done with the changes.

from quickmd.

AndrewRadev avatar AndrewRadev commented on August 19, 2024 1

It should be possible to omit modifiers entirely. Right now this causes a parsing error.

Yeah, that's true, fixed.

And, since you're imitating the format of Alacritty's config anyway, why not reuse it's nocemclature directly? So mods instead of modifiers, etc. Unless you feel it's not clear or explicit enough.

"Mods" sounds good enough to me 👍

key_name values should probably be normalized, so that e.g. both "escape" and "Escape" work (right now only the second does).

The problem with this is that there doesn't seem to be a consistent normalization. If it was just about lowercasing, that'd be fine, but "Escape" works where "Minus" doesn't -- it's "minus". Really, the core problem both with this and the common "Key" prop is that I'm just delegating to GDK trying to do as little special work as possible 😅. Not just because of the extra work, but also because I don't know about subtleties that GDK handles, like = is actually shift + +, for example, but is that going to be the same on non-qwerty keyboards? I feel like I'd rather just give whatever comes in to GDK and tackle problems as they come in, which is why I opted to do it both ways.

Using name universally would work for the alphabetic keys, I think, but it wouldn't work for +, -, I don't know what else. For now, I'd rather not touch this part. Maybe I'll come back to it later.

from quickmd.

AndrewRadev avatar AndrewRadev commented on August 19, 2024 1

I've merged the branch and cut a new release, I added your PR as well (sorry again for missing it). With this, I'll close this issue for the moment. Feel free to reopen if you find any bugs or want to discuss changes, or you could open a new one.

from quickmd.

cheap-glitch avatar cheap-glitch commented on August 19, 2024

Side note: the readme mentions that

Pressing escape will close the window.

But it doesn't work for me. Nothing appears in the debug output either.

Is this an actual bug, or was it removed but the readme wasn't updated?

from quickmd.

cheap-glitch avatar cheap-glitch commented on August 19, 2024

Could you try it out and let me know if it makes sense to you?

It works well!

Some quick notes/ideas:

  • It should be possible to omit modifiers entirely. Right now this causes a parsing error.

  • key_name values should probably be normalized, so that e.g. both "escape" and "Escape" work (right now only the second does).

  • In fact, it would be nicer to just have a single attribute named key like in Alacritty's config, instead of having to choose between key_name/key_char. Though I don't know how tricky it would be for the code to guess which one the user meant.

  • And, since you're imitating the format of Alacritty's config anyway, why not reuse it's nocemclature directly? So mods instead of modifiers, etc. Unless you feel it's not clear or explicit enough.

All of these are only minor quibbles or "would-be-nice-to-have" features, it still does the job well enough 👍

from quickmd.

Related Issues (13)

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.