Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macros outpaces goto definition, leading to unexpected behaviour #9254

Open
LilyIsTrans opened this issue Jan 5, 2024 · 1 comment
Open
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug

Comments

@LilyIsTrans
Copy link

Summary

When gd jumps to another file in a macro, unexpected behaviour occurs. From the results, it looks like the macro is continuing to execute keystrokes before helix has loaded the destination file, resulting in some keystrokes being missed in the destination file (presumably having been executed on the origin file).

Reproduction Steps

I encountered this trying to use a macro to quickly open the documentation for Vulkan device extensions in the following code using vulkano.

// init_renderer.rs

use vulkano as vk;
// Lots of intermediate steps...
        let needed_extensions = vk::device::DeviceExtensions {
            khr_buffer_device_address: todo!(),
            khr_copy_commands2: todo!(),
            khr_create_renderpass2: todo!(),
            khr_dedicated_allocation: todo!(),
            // Lots more extensions...
        };

Jumping into:

// device_extensions.rs
// ... 
pub struct DeviceExtensions {
    #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_16bit_storage.html)\n- Promoted to Vulkan 1.1\n- Requires all of:\n  - Vulkan API version 1.1 or instance extension [`khr_get_physical_device_properties2`](crate::instance::InstanceExtensions::khr_get_physical_device_properties2)\n  - Vulkan API version 1.1 or device extension [`khr_storage_buffer_storage_class`](crate::device::DeviceExtensions::khr_storage_buffer_storage_class)"]
    pub khr_16bit_storage: bool,
    #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_8bit_storage.html)\n- Promoted to Vulkan 1.2\n- Requires all of:\n  - Vulkan API version 1.1 or instance extension [`khr_get_physical_device_properties2`](crate::instance::InstanceExtensions::khr_get_physical_device_properties2)\n  - Vulkan API version 1.1 or device extension [`khr_storage_buffer_storage_class`](crate::device::DeviceExtensions::khr_storage_buffer_storage_class)"]
    pub khr_8bit_storage: bool,
    #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_acceleration_structure.html)\n- Requires all of:\n  - Vulkan API version 1.1\n  - Vulkan API version 1.2 or device extension [`ext_descriptor_indexing`](crate::device::DeviceExtensions::ext_descriptor_indexing)\n  - Vulkan API version 1.2 or device extension [`khr_buffer_device_address`](crate::device::DeviceExtensions::khr_buffer_device_address)\n  - device extension [`khr_deferred_host_operations`](crate::device::DeviceExtensions::khr_deferred_host_operations)"]
    pub khr_acceleration_structure: bool,
    #[doc = "- [Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_bind_memory2.html)\n- Promoted to Vulkan 1.1"]
    pub khr_bind_memory2: bool,
    // ...
}
// ...

using this macro:
gd<up>t(<right><right>t):pipe<minus>to<space>xargs<space><minus><S-I><space>_<space>firefox<space>_<ret><C-o>
with the primary (and only) cursor hovering on the field for an extension in normal mode.

When recording the macro, it works exactly as expected, opening 1 new tab with the documentation page.

When playing back the macro, it opens 2 tabs, the first of which always has it's URL set to http:https://),/, and the second of which having it's URL set to something of the form: file:https://[PATH_TO_PROJECT_DIRECTORY]/khr_copy_commands2:%20todo!(.

Helix log

~/.cache/helix/helix.log
please provide a copy of `~/.cache/helix/helix.log` here if possible, you may need to redact some of the lines

helix_macro_too_fast_stripped3.log

Platform

Linux

Terminal Emulator

kitty 0.30.1 created by Kovid Goyal

Installation Method

pamac (repositories/extra)

Helix Version

helix 23.10

@LilyIsTrans LilyIsTrans added the C-bug Category: This is a bug label Jan 5, 2024
@pascalkuthe
Copy link
Member

See #6436

@kirawi kirawi added the A-helix-term Area: Helix term improvements label Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

3 participants