mirror of https://github.com/tstack/lnav
[blog] add post for cursor mode
parent
19de26e4c2
commit
7f18aa9cd9
@ -0,0 +1,17 @@
|
|||||||
|
---
|
||||||
|
layout: default
|
||||||
|
---
|
||||||
|
|
||||||
|
<div class="post">
|
||||||
|
|
||||||
|
<header class="post-header">
|
||||||
|
<h1 class="post-title">{{ page.title }}</h1>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<article class="post-content">
|
||||||
|
{{ content }}
|
||||||
|
</article>
|
||||||
|
|
||||||
|
<script src="/assets/js/codeblock.js"></script>
|
||||||
|
|
||||||
|
</div>
|
@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
layout: post
|
||||||
|
title: Cursor Mode
|
||||||
|
excerpt: Move around the main view using a cursor
|
||||||
|
---
|
||||||
|
|
||||||
|
*(This change is in [**v0.11.2+**](https://github.com/tstack/lnav/releases/tag/v0.11.2-rc3))*
|
||||||
|
|
||||||
|
The major change in the v0.11.2 release is the addition of a "cursor mode"
|
||||||
|
for the main view. Instead of focusing on the top line for interacting
|
||||||
|
with **lnav**, a cursor line is displayed and interactions focus on that.
|
||||||
|
The arrow keys and the hotkeys that jump between bookmarks, like search
|
||||||
|
hits and errors, now move the focused line instead of scrolling the view.
|
||||||
|
To help provide context for what you're looking at, large jumps will keep
|
||||||
|
the focused line in the middle of the view. Smaller movements, like
|
||||||
|
moving the cursor above the top line, will scroll the view a small amount
|
||||||
|
so as not to be jarring.
|
||||||
|
|
||||||
|
You can enable/disable cursor mode interactively by pressing `CTRL` + `x`.
|
||||||
|
Or, you can permanently enable cursor mode by running the following
|
||||||
|
`:config` command:
|
||||||
|
|
||||||
|
```
|
||||||
|
:config /ui/movement/mode cursor
|
||||||
|
```
|
||||||
|
|
||||||
|
<script async
|
||||||
|
id="asciicast-d94CmxlGM01I0L5HNn9qDn917"
|
||||||
|
src="https://asciinema.org/a/d94CmxlGM01I0L5HNn9qDn917.js">
|
||||||
|
</script>
|
@ -0,0 +1,23 @@
|
|||||||
|
var codeBlocks = document.querySelectorAll('pre.highlight');
|
||||||
|
|
||||||
|
codeBlocks.forEach(function (codeBlock) {
|
||||||
|
var copyButton = document.createElement('button');
|
||||||
|
copyButton.className = 'copy';
|
||||||
|
copyButton.type = 'button';
|
||||||
|
copyButton.ariaLabel = 'Copy code to clipboard';
|
||||||
|
copyButton.innerText = 'Copy';
|
||||||
|
|
||||||
|
codeBlock.append(copyButton);
|
||||||
|
|
||||||
|
copyButton.addEventListener('click', function () {
|
||||||
|
var code = codeBlock.querySelector('code').innerText.trim();
|
||||||
|
window.navigator.clipboard.writeText(code);
|
||||||
|
|
||||||
|
copyButton.innerText = 'Copied';
|
||||||
|
var fourSeconds = 4000;
|
||||||
|
|
||||||
|
setTimeout(function () {
|
||||||
|
copyButton.innerText = 'Copy';
|
||||||
|
}, fourSeconds);
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue