Skip to content

Calendar motions for =$= and =0= not behaving as expected #986

Closed
@celsobenedetti

Description

@celsobenedetti

Describe the bug

Hello, thank you so much for your amazing work! Truly appreciated :)

What I report here is the behavior of the $ and 0 motions on the calendar view.

When in a given week row, the $ and 0 are not taking us to the last/first day, but to the edges of the buffer itself. After these motions, the behavior of hjkl may result in errors being thrown, I suppose the calendar is left in an unexpected state, and the self:get_selected_date() calls are not working correctly.

Related PR: #987

Steps to reproduce

  1. Open a calendar view, like with <leader>ois
  2. Navigate to a week row
  3. Press $ and/or 0
  4. Continue navigating with hjkl

Expected behavior

  • $ should take us to the last day of the week.
  • 0 should take us to the first day of the week.

Emacs functionality

I'm not sure tbh. Never used it.

Minimal init.lua

Managed to reproduce with this:

-- [[ Install `lazy.nvim` plugin manager ]]
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
  local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
  vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
end ---@diagnostic disable-next-line: undefined-field
vim.opt.rtp:prepend(lazypath)

require('lazy').setup {
  {
    'nvim-orgmode/orgmode',
    event = 'VeryLazy',
    ft = { 'org' },
    config = function()
      -- Setup orgmode
      require('orgmode').setup {
        org_agenda_files = { '~/notes/orgfiles/**/*' },
      }
    end,
  },
}

Screenshots and recordings

Here is a video demonstrating this in master 55b68bb

Kazam_screencast_00016.mp4

nvim-orgmode version

55b68bb

OS / Distro

OS: Pop!_OS 22.04 LTS x86_64

Neovim version/commit

NVIM v0.11.0 Build type: Release LuaJIT 2.1.1741730670 Run "nvim -V1 -v" for more info

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions