Giter Club home page Giter Club logo

d.vim's People

Contributors

a-r-t-u-r-g avatar commonquail avatar jessekphillips avatar jneen avatar joakim-brannstrom avatar john-colvin avatar mrmonday avatar petarkirov avatar rcorre avatar tamy0612 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

d.vim's Issues

Comments incorrectly highlighted in ASM block

Suggested addition/modification:

syn region dAsmBody start="asm[\n]\s{"hs=e+1 end="}"he=e-1 contains=dAsmStatement,dAsmOpCode, dBlockComment,dNestedComment,dLineComment, dUserLabel

--- Shahid

Syntax confusion when identifier ends with 'module'

struct testmodule { }
void main() {
}

In the above example, everything following the declaration of testmodule has no syntax coloring, presumably because of the use of the word module at the end of an identifier.

2D array literal indentation

The following declaration:

auto a = [
    [ 1, 2, 3, 4 ],
    [ 1, 2, 3, 4 ],
    [ 1, 2, 3, 4 ],
    [ 1, 2, 3, 4 ],
];

is indented like so (when using ==):

auto a = [
    [ 1, 2, 3, 4 ],
    [ 1, 2, 3, 4 ],
        [ 1, 2, 3, 4 ],
            [ 1, 2, 3, 4 ],
];

Folding code

Hi,
I suggest to allow folding D code. To do this just add this command

set foldmarker={,}

Then D code will be recognize to fold region where start by a { and end with }

Maybe this should be enhance to support one line condition as

if( isAscii )
    doFoo();

Error in parsing modules

I am getting this error when importing class from file.

Error: module someclass is in file 'someclass.d' which cannot be read

derror_vim

First I thought I am the one who makes a mistake with having error in my code. I read part about modules in D tutorial one more time, but I think there's a bug in d.vim as output of the application is right.

derror_output

Keywords that are both storage class and statements are not highlighted appropriately

Several keywords (e.g., in, out, inout) are both storage class and statements, depending on their context. Perhaps use pattern matching to figure out which and highlight appropriately. For now I have made such keywords storage classes so their highlighting is consistent with other keywords that are commonly used with them, but are true storage classes, such as lazy. Similarly, I made some statement keywords (e.g. body) storage classes.

-- Jason Mills

Re-examine how syntax sync is handled

Currently minlines is set to a large number to help prevent poor highlight. It would be good to find more areas that syntax can be synchronized with so this number can be reduced.

neovim's runtime files for D are outdated

Looking at neovim, I found that its D files are quite outdated. I'm not familiar with neither vim, nor neovim's development processes, so I'm not sure whom to reach to request an update.
Can you help me get neovim's D support updated?

indentation wrong with /+ +/

module foo.bar;

/+
a (foo):
TIME=1
+/

struct Option{
string file;
}

void fun(){
int a;
}

/*
a (foo):
TIME=1
*/

struct Option{
string file;
}

void fun(){
int a;
}

Vim hangs on typing "in" at the beginning of a line

I noticed the weirdest thing yesterday, when I wanted to change a void main() to int main(). Vim just froze, and refused to do anything until I did a Ctrl+c.

On digging further, I saw that this happened only with .d files, so I thought the d.vim plugin may have something to do with it. If I disable d.vim using:

set runtimepath-=~/.vim/bundle/d.vim
set runtimepath-=~/.vim/bundle/d.vim/after

in my vimrc, then Vim doesn't hang. This seems to confirm that the issue may lie in something that's going on in d.vim.

To reproduce it, all you need to do is open any .d file (with d.vim enabled of course), and type i followed by n. That's it. The CPU usage of Vim should spike to 100%, and it should just freeze. Ctrl+c does get you out of it though.

Note that this happens only when typing i followed by n at the start of a line. I can happily type in anywhere else without issues!

Using latest d.vim, with Vim version 7.3 running on Ubuntu 13.10 64 bit.

Trailing comment indicators are not highlighted

In the event of a multi-line comment, e.g.:

/*  for (i = 0; i < 10; ++i)
    {
        writeln(i);
    }*/

... deleting the opening /* in C/C++ will result in the trailing */ being highlighted in red as an error. d.vim should similarly colour trailing comment end-marks (currently it just leaves them uncoloured).

The fix should also apply to /+ ... +/ comment blocks.

Add fold markers

Email from Sohgo Takeuchi

I have written a patch to add a folding feature to d.vim.
This patch enables folding comments(/* */ and /+ +/) and blocks
({}) like c.vim when setting "foldmethod=syntax".

--- d.vim.old 2010-12-22 16:39:06.000000000 +0900
+++ d.vim 2010-12-22 16:36:57.000000000 +0900
@@ -161,12 +161,12 @@
syn region dBlockCommentString contained start=+"+ end=+"+ end=+*/+me=s-1,he=s-1 contains=dCommentStar,dUnicode,dEscSequence,@spell
syn region dNestedCommentString contained start=+"+ end=+"+ end="+"me=s-1,he=s-1 contains=dCommentPlus,dUnicode,dEscSequence,@spell
syn region dLineCommentString contained start=+"+ end=+$|"+ contains=dUnicode,dEscSequence,@spell

  • syn region dBlockComment start="/" end="/" contains=dBlockCommentString,dTodo,@spell
  • syn region dNestedComment start="/+" end="+/" contains=dNestedComment,dNestedCommentString,dTodo,@spell
  • syn region dBlockComment start="/" end="/" contains=dBlockCommentString,dTodo,@spell fold
  • syn region dNestedComment start="/+" end="+/" contains=dNestedComment,dNestedCommentString,dTodo,@spell fold
    syn match dLineComment "//.*" contains=dLineCommentString,dTodo,@spell
    else
  • syn region dBlockComment start="/" end="/" contains=dBlockCommentString,dTodo,@spell
  • syn region dNestedComment start="/+" end="+/" contains=dNestedComment,dNestedCommentString,dTodo,@spell
  • syn region dBlockComment start="/" end="/" contains=dBlockCommentString,dTodo,@spell fold
  • syn region dNestedComment start="/+" end="+/" contains=dNestedComment,dNestedCommentString,dTodo,@spell fold
    syn match dLineComment "//.*" contains=dLineCommentString,dTodo,@spell
    endif

@@ -280,6 +280,10 @@
" TODO: Highlight following Integer and optional Filespec.
syn region dPragma start="#\s*(line>)" skip="$" end="$"

+" Block
+"
+syn region dBlock start="{" end="}" transparent fold
+

" The default highlighting.
"

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.