Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Insert mode <CR> always over-indents when #+TITLE is missing

Aperta
#1,079 1 commento 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
lua
Ambito
tooling

Direzione di ricerca

Inizia da lua/org/indent.lua alle tre righe collegate intorno a L76-L78, quindi riproduci il problema usando l’init.lua minimo e un file org senza una riga #+TITLE. Confronta l’indentazione di insert-mode per la struttura fornita; il lavoro è completo quando l’output corrisponde all’indentazione prevista e si comporta allo stesso modo quando #+TITLE è presente o assente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
Describe the bug

I tested this with a minimal config with only orgmode and nvim-treesitter.
In an orgmode file without #+TITLE as the first line, hitting <CR> in insert mode indents when it should not.

If I type out the following entirely in insert mode, with zero manual indentation, each indents more than it should (especially annoying for hyphen bulleted lists where each new item indents deeper):

* head
   ** a
   - b 
     - c
       - d

The output I expect:

* head
** a
   - b 
   - c
   - d

If I comment out these 3 lines the bug dissapears:
https://github.com/nvim-orgmode/orgmode/blob/3629625199b9a45bdb41fa734bc2c6ef86d251bd/lua/orgmode/org/indent.lua#L76-L78`

checkhealth

==============================================================================
orgmode: ✅

Orgmode ~

  • ✅ OK Treesitter grammar installed (version 2.0.2)
  • ✅ OK Setup called
  • ✅ OK org_agenda_files configured
  • ✅ OK org_default_notes_file configured
Steps to reproduce
  1. Open test.org
  2. Type out the following outline without any manual indentations, entirely in insert mode:
    Expected:
* head
** a
   - b 
   - c
   - d

Actual:

* head
   ** a
   - b 
     - c
       - d
Expected behavior

Indentation should behave the same whether #+TITLE exists or not

Emacs functionality

No response

Minimal init.lua

-- minimal_init.lua
-- Ensure you use the correct syntax for your plugin manager (e.g., Packer, lazy.nvim, etc.)

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"

if not vim.uv.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "--branch=stable",
    "https://github.com/folke/lazy.nvim.git",
    lazypath,
  })
end

vim.opt.rtp:prepend(lazypath)

require("lazy").setup({
  -- Specify only the plugins you need for troubleshooting:
  "nvim-treesitter/nvim-treesitter",
  -- Add other specific plugins here
  {
    'nvim-orgmode/orgmode',
    event = 'VeryLazy',
    ft = { 'org' },
    config = function()
      -- Setup orgmode
      require('orgmode').setup({
        org_agenda_files = '~/orgfiles/**/*',
        org_default_notes_file = '~/orgfiles/refile.org',
      })
    end,
  },
})


Screenshots and recordings

https://asciinema.org/a/Bxa13dKwP3pIN7cIcbx9RyHp8

nvim-orgmode version

3629625199b9a45bdb41fa73

OS / Distro

MacOS 26.1

Neovim version/commit

v0.11.2

Additional context

No response

Lingua principale
Lua
Stelle
3.9k
Fork
192
Merge medio
1g 10h
PR unite (30g)
11

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di nvim-orgmode/orgmode

Tutte le issue di nvim-orgmode/orgmode

Issue simili

Altre issue su Lua

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.