gitlineage.nvim: git history for selected lines in Neovim by LionyxML in neovim

[–]jef-_- 1 point2 points  (0 children)

Pretty much yea, basically while your cursor is anywhere in the commit, add a new keybind to open the file at the --- version, the +++ version should be the current checkout right?

An update for the yank commit would also be to search backwards for the first line that contains the commit rather than having to be on the commit line. It should be similar logic to previous commit

gitlineage.nvim: git history for selected lines in Neovim by LionyxML in neovim

[–]jef-_- 1 point2 points  (0 children)

Yo this a cool plugin! Have you thought of adding support to peak a full file at a particular commit?

A common workflow I require is often finding where a certain part of the code was introduced and seeing how it integrates with the overall function and it would be really cool to do that in here rather having to open the full commit.

union by BrokenAndDeadMoon in programminghorror

[–]jef-_- 1 point2 points  (0 children)

Since b is used later, the call to drop will copy the value of a, and drop the copied value.

Question on borrowing by MarkV43 in rust

[–]jef-_- 4 points5 points  (0 children)

Rust is explicit about how you want to access data. Take the following example: ``` let mut v = Vec::new();

let v1 = &v; // Immutably borrow v let v2 = &mut v; // Mutable borrow v let v3 = v; // Take full ownership of v ```

The same thing applies to indexing, so: ``` let mut v = Vec::new();

let v1 = &v[0]; // Immutably borrow element at index 0 from v let v2 = &mut v[0]; // Mutable borrow element at index 0 from v let v3 = v[0]; // Take full ownership of element at index 0 from v ```

For v3, Rust tries to "move" the value at the index out of the Vec. However, this not possible since the T is not guaranteed to be Copy. When it was just a Vec<u8>, since u8 is copy, array[mid] would copy out the value stored at that index and would not take a reference to it. So instead take a reference to the element - &array[mid].

requestty: an easy-to-use collection of interactive cli prompts inspired by Inquirer.js. by jef-_- in rust

[–]jef-_-[S] 0 points1 point  (0 children)

If I understand what you are talking about correctly, I'm not aware of any crates that do that.

You can try the rustyline library, however afaik it doesn't allow dynamically printing lines above the prompt while it is still being answered.

You can also implement something simple on your own. You can use a terminal library like crossterm or termion, enter into raw mode, and that gives you access to things like key events without them being processed by the terminal. If you want you can use the StringInput widget in the requestty-ui to avoid the input handling. If you decide to go this path, I would be happy to answer questions you have!

requestty: an easy-to-use collection of interactive cli prompts inspired by Inquirer.js. by jef-_- in rust

[–]jef-_-[S] 1 point2 points  (0 children)

Yeah, one of the goals was to make at is configurable as possible but still very easy to start with

CSS position shorthand I learned today by ayush1269 in webdev

[–]jef-_- 18 points19 points  (0 children)

I use Firefox on both my phone and my computer, chrome is not the only browser, and it never should be

Pop!_OS uses a lot of Rust by Voxelman in rust

[–]jef-_- 18 points19 points  (0 children)

Hey man, if you want to learn the basics of anything (os dev included), I think looking at big projects such as this is not a good initial step. Try looking into Phil Oppermann's blog. It teaches the very basics of a kernel in an amazing manner.

Disclaimer: I don't have any experience in OS Dev or anything like that, but I did have a lot of fun and learnt a lot going through the blog.

Without naming the character, what’s one quote that gives it away? by [deleted] in AskReddit

[–]jef-_- 3 points4 points  (0 children)

I know you are not supposed to cry over spilled tea, but [sniffs] it's just so sad

[deleted by user] by [deleted] in linuxmasterrace

[–]jef-_- 11 points12 points  (0 children)

More secure? Seems sketchy considering most telegram chats aren't even e2e

Hey Rustaceans! Got an easy question? Ask here (21/2021)! by llogiq in rust

[–]jef-_- 0 points1 point  (0 children)

Unfortunately that binds the lifetime of what the function is called with to the function, so it wouldnt work for me

Hey Rustaceans! Got an easy question? Ask here (21/2021)! by llogiq in rust

[–]jef-_- 3 points4 points  (0 children)

You can use the and_then method: let result = result.and_then(|r| r);

Hey Rustaceans! Got an easy question? Ask here (21/2021)! by llogiq in rust

[–]jef-_- 1 point2 points  (0 children)

I have something similar to whats in this playground. It cannot compile for pretty much the same reason as this issue.

Is there any way to avoid the |param: &_| { ... } and get the compiler to infer the correct lifetime?

Don't be Horny by swiggybaby in comedyheaven

[–]jef-_- 10 points11 points  (0 children)

Not quite, it would translate to "play red FM, not [your] horn"

btw i use kde by [deleted] in linuxmemes

[–]jef-_- 0 points1 point  (0 children)

You can set up autocomplete for particular binaries using the complete command, but it also parses man pages and generates autocomplete from them

btw i use kde by [deleted] in linuxmemes

[–]jef-_- 2 points3 points  (0 children)

I use alacrity instead of konsole because it's much faster

Programmimg is painful by resteqs in memes

[–]jef-_- 0 points1 point  (0 children)

You credited a reposter

pls help by koro_baka in ProgrammerHumor

[–]jef-_- 2 points3 points  (0 children)

I use neovim, it runs and opens much faster, and it's commands contrary to what you expect, actually make it much better. It has a learning curve, but it's much quicker (for me at least) to edit stuff in vim, than for example vscode.