Git Product home page Git Product logo

Comments (3)

saulpw avatar saulpw commented on June 21, 2024 1

What is this shortcut code for? What's an example where a keystroke from the command log can be thought of as a shortcut?

The shortcut shown on the status bar before the sheetname: 1›sample. For regular sheets, it's assigned; the intention is that if you opened a non-precious sheet, the "shortcut" would be the key you used to open it, like C for the columns sheet or O for the options sheet. But this usage was disabled (when Shift+C just did not look right and I wasn't sure about it anyway), so these days the shortcut is only meaningful for precious sheets.

Thanks for looking into all this, by the way. I know this code can get pretty convoluted over time.

from visidata.

midichef avatar midichef commented on June 21, 2024

Okay I've got a clearer idea of exactly when this happens. It's when you create a sheet without using keystrokes. Like a command started by exec-command, or a help menubar entry, or clicking a statusbar link. The sheet has to have precious == False, like a HelpSheet or OptionsSheet. So. running exec-longname and then choosing help-commands.

return str(vd.allSheets.index(self)+1)

Because the sheet isn't precious, it can't be found in vd.allSheets, so the command log is searched for keystrokes. But there are no keystrokes because the action that triggered the command wasn't a keypress.

from visidata.

midichef avatar midichef commented on June 21, 2024

As a secondary issue, I wonder if

return self.cmdlog_sheet.rows[0].keystrokes

has a remaining problem, when it uses rows[0]. It assumes the first row of the command log is the one that created the sheet. But they're usually set-options commands. (This same assumption caused a problem with undo in #2244.) It seems like that may cause an error.

I haven't yet found a case it does. But before I dig deeper, what is this shortcut code for? What's an example where a keystroke from the command log can be thought of as a shortcut?

from visidata.

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.