Code Monkey home page Code Monkey logo

coolformat's Issues

有没有Source Insight 3.5 的插件

Source Insight支持自定义命令和插件脚本,如果能把CoolFormat做成插件,使用起来一定很便利。
多个工具之间复制粘贴感觉有点儿麻烦。

verilog的格式化功能

嗨作者 还记得我吗 之前跟你反馈verilog 格式化不起作用的
请问这个功能什么时候能加好啊 好期待啊~

\不能识别,最多行数限制不好用

int test() {

string str =
    "dfdffddfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbb";
string ss = "sdfsfs \

svfdsfs";
string s = "dfd"
"sdfss"
"sds";
}

1、当string类型过长时,最大行数设置的也只是仅仅将值换到下一行,可是值依然超过80行了
2、代码格式化后,反斜杠不能识别,下一行提前了两个空格。

在英文操作系统下可能切换界面语言失败

在英文操作系统下,并且安装了东亚语言支持,可以正常显示中文,但是非Unicode系统区域设置为非中文,这时可能将界面语言设置为‘中文’,但是还是显示成英文。

所选格式化没有起始缩进

只想格式化所选的,但是格式化后,没有起始缩进。示例:

function myFunction()
{
/* 只格式化以下 */
if ('this_is' == /an_example/)
{
    of_beautifer();
}
else
{
    var a = b ? (c % d) : e[f];
}   
}

JSON遇到Unicode编码产生乱码问题

JSON代码:

{
   "employees" : [
      {
         "firstName" : "Bill",
         "lastName" : "\u64cd\u4f5c"
      }
   ]
}

会被格式化成乱码:

{
   "employees" : [
      {
         "firstName" : "Bill",
         "lastName" : "鎿嶄綔"
      }
   ]
}

XML格式化不支持中文标签

因为tidy内核问题,不支持中文标签,但是对XML来说,这是必要的。
格式化失败示例:

<?xml version="1.0" encoding="gb2312"?>
<商店><书籍>aaa</书籍><电影>bbb</电影></商店>

两个问题

1)既然作为开源软件,为什么不使用Qt+Ribbon?
2)项目中有Pro文件,使用Qt打开后发现里面只能生成lib,而没有app,即没有可执行程序生成。

希望增加新功能,保留剪切板上的文字颜色

比如将代码从VS复制到剪切板上,这时候是保留了颜色信息的
我建议在粘贴到CoolFormat时提供选项,可以选择粘贴纯文本或者保留颜色
纯文本就套用CoolFormat的高亮配置,如果已有颜色就采用原来颜色
继续支持一下大大,软件很好用

java 格式化代码问题

`public class Utils {

public static int parseInt(String value, int defValue)               {
    try {
        return Integer.parseInt(value);
    } catch (Exception e) {
        return defValue;
    }
}

}`

java代码中函数或者类的左括号和名字在同一行,不会对左括号进行格式化,上面的就是测试代码。
如果括号和名字不在同一行就可以格式化了,我用的是 V3.4 版本,命令行方式 -f

文本过长会自动换行,并且解析错误

我有程序里面返回的一个json字符串,只有一行,但是有40W个字符.
复制到notpad++里面时正常显示为1行
但是复制到CoolFormat里面时,显示为20行
并且点击格式化时,因为在不正确的地方换行,导致解析错误

image
image
由上两图可见,就是在nullzhe这个地方,切换了换行,变成了第七行以nul结尾,第八行以l开头,导致解析错误

请问可以识别 define 后的for语句吗?

sublime3 安装此插件后其他都很好用,但有一个问题:
使用
#define For(i,x,y) for(int i=x;i<y;++i)
语句后,在程序内使用如下语句的时候

For(i,0,n)
cin>>a[n];

那句cin 无法自动缩进,是哪里设置有问题吗?

请支持这些语法:Markdown, Shell Script, ISC-style configuration file

您好,

希望能增加支持以下语法。支持高亮就好,格式化相对来说不那么重要。

  • Markdown: 在技术界,Markdown的重要性无需赘述。
  • Shell Script: Linux/Unix下的shell脚本。是Linux/Unix下使用最广泛的命令行脚本。
  • ISC-style configuration file: 也叫Apache style configuration file。绝大多数Linux/Unix下的软件(以及部分跨平台的软件)都采用这种设置文件格式。

相信增加这些语法的支持可以很大程度上增加这软件的覆盖率。望作者考虑!

Conditional Operator Indentation Issue

I am having an issue with CoolFormat inserting indentation into multi-line conditional statements.

This is the format I use for conditional statements:

if ( ( condition_1 == false )
&& ( condition_2 == false ) )
    {
        if ( ( condition_3 == false )
        || ( condition_4 == false ) )
            { doThis (); }

        else if ( ( ( condition_3 == true )
        && ( condition_4 == true ) )
            ||
        ( ( condition_3 == false )
        ( condition_4 == true ) ) )
            {  doThat (); }
    }

This is the result after performing a QuickFormat:

if ( ( condition_1 == false )
     && ( condition_2 == false ) )
    {
        if ( ( condition_3 == false )
             || ( condition_4 == false ) )
            { doThis (); }

        else if ( ( ( condition_3 == true )
                    && ( condition_4 == true ) )
                  ||
                  ( ( condition_3 == false )
                    ( condition_4 == true ) ) )
            {  doThat (); }
    }

My configuration:
Java=""-A7-T-C-xG-S-K-N-L-m0-f-p-P-d-D-xd-H-k2-W2-y-j-J-O-o-c-xy""

I have also tried removing all CoolFormat operators aside from the "A7" format, using different formatting schemes, & implementing the "m0" operator. However, for some reason the conditional operators are always indented when they are on separate lines.

This ANSI plugin is not compatible with your Unicode Notepad++

我使用的是Notepad++6.9.1版本

把工程所有项目属性都修改为了 使用 Unicode 字符集
编译后把CoolFormatLib.dll,CoolFormatNppPlugin.dll 放到Notepad++ plugins目录
运行Notepad++,提示 This ANSI plugin is not compatible with your Unicode Notepad++

https://sourceforge.net/projects/coolformat/files/Plugins/NPP/ 下载1.1版本
使用这个报同样错误。

我检查了所有项目,都是Unicode属性,不知为什么编译出来的dll会被Notepad++认为是Ansi的。

C/C++ 预处理语句缩进错误

#if defined 开头的预处理语句 到 #endif 之间无法缩进
示例代码:
#if defined ABC

#ifdef KK
#endif

#else

#ifdef BBB
#define HGF

#endif

#endif
#define OPP 1

#if OPP
#ifdef HGF
#define OOO
#endif
#endif

#if defined HGF && defined OOO
#ifdef KKK
#undef OOO
#endif
#endif

C++数组空格

数组留空格
例如:
int array[COLS_CNT][ROWS_CNT];
能否提供如下格式转换:
int array[ COLS_CNT ][ ROWS_CNT ];

Change Keyboard Binding in sublime3

Hello, currently I use this amazing plugin is my sublime text 3.
I want to change the keyboard binding of this plugin in my user keybinding.

But I don't know the command of these two operations.
Hope you could help me.

Best Regards,
Zhengshuai

C/C++ pad operators 无法给异或'^'添加空格

C/C++设置 pad operatorsyes
a=a^*b++; 这样的代码中 ^ 前后不会添加空格。
经多种测试,发现是出现了 ^* 的原因。
a^=*b++ 这样的会被格式化为a ^= *b++
而且 b ++ 不会被格式化成 b++,已设置 unpad parens

下面是设置
C++=""-A1-s4-S-K-xW-w-Y-m2-M40-f-p-U-k3-W3-xj-c""

qt 工程编译问题

用Qt编译时,CoolFormatLib.pro中要加INCLUDEPATH += ../Include ../FormatterLib/SqlFormatterLib ../FormatterLib/CssTidyLib ../FormatterLib/JsonCppLib ../FormatterLib/JsFormatterLib ../FormatterLib/PhpFormatterLib ../FormatterLib/tidy/src ../FormatterLib/AStyle/src
否则会有头文件找不到的问题

不能识别PHP5.4中的新语法

格式化PHP代码时报错,原因是认为下面的代码有语法错误:
$c = $a ?: $b;
其实这是PHP5.4新添加的语法,相当于原来的
$c = $a ? $a : $b;

另一个报错是数组的JSON式定义语法:
$d = ['a' => 1];
相当于原来的
$d = array('a' => 1);

导出配置失败

3.4版本,导出配置后在目标文件夹下面没有配置文件,Win8.1 x64

插件不可用

编译生成的插件,在Notepad++ unicode版本下不可用。需要unicode版本

PhpFormatterLib单独编译出现逻辑错误

您好,我尝试单独编译了PhpFormatterLib模块,主函数改为直接调用phpTidy->TidyMain函数。

输入代码都会在node.cpp:151行报错,原因是last节点出现了一个空字符串(应该是Node节点生成出了bug),当访问[0]元素时出错,不知是哪里出了问题。下面是我测试的php样例代码:

parse.cpp当中语句debug("Token: %s", yytname[YYTRANSLATE(yychar)])输出 如下:
Token: T_OPEN_TAG String:
Token: $ String:

PS:为什么没看到 .l 以及 .y 文件呢 (⊙⊙?)

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.