Coder Social home page Coder Social logo

Comments (4)

chrisbra avatar chrisbra commented on September 22, 2024

ping @philj56

from vim.

ebiggers avatar ebiggers commented on September 22, 2024

I ran into this too: //-style comments are being indented incorrectly. I worked around this by deleting /usr/share/vim/vim91/indent/asm.vim from my system.

from vim.

philj56 avatar philj56 commented on September 22, 2024

@zack466 Hey, sorry for the slow response.

I think that's a pretty reasonable argument; this was a originally a very minimal-effort file for my personal use. It's included in vim because at least one other person wanted it (The original PR's at #14383).

I don't have any particularly strong opinions on it staying in or not, so if it's annoying multiple people, it's probably best off removed. It could also be modified to be much less zealous in its indenting while still achieving my original goals, by changing the GetAsmIndent function to something like:

function! GetAsmIndent()
  let line = getline(v:lnum)

  " If the line is a label (starts with ':' terminated keyword), 
  " then don't indent
  if line =~ '^\s*\k\+:'
    let ind = 0
  else
    " If the previous line was a label, indent:
    if getline(v:lnum - 1) =~ '^\s*\k\+:'
      let ind = s:buffer_shiftwidth()
    else
      " Let autoindent handle everything else.
      let ind = -1
    endif
  endif

  return ind
endfunction

This would mean basically nothing gets touched apart from labels and the lines directly after them.

from vim.

chrisbra avatar chrisbra commented on September 22, 2024

Hm, the s:buffer_shiftwidth() function seems undefined. Let me remove the indent script then if it causes problems.

from vim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.