如何在IntelliJ中按文件类型配置“在保存时删除尾随空格”?

时间:2016-07-03 17:07:45

标签: intellij-idea markdown

对于大多数文件,尾随空格的强力自动剥离是一个很好的功能,除了Markdown。

AFAIK,在Markdown中添加换行符(相当于 public class TheRecyclerAdapter extends RecyclerView.Adapter<TheRecyclerAdapter.TheViewHolder> { private Context mContext; private List<TheData> theDataList; public class TheViewHolder extends RecyclerView.ViewHolder{ TextView theHiddenView; public TheViewHolder(View itemView) { super(itemView); theHiddenView = (TextView) itemView.findViewById(R.id.hiddenView); } } public TheRecyclerAdapter(Context context, List<TheData> theDatalist){ this.mContext = context; this.theDataList = theDatalist; } @Override public TheViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.custom_view_adapter, parent, false); return new TheViewHolder(itemView); } @Override public void onBindViewHolder(final TheViewHolder holder, int position) { TheData theData = theDataList.get(position); holder.theHiddenView.setTag(theData.getHiddenTag()); //Set the TAG of Hidden View here } @Override public int getItemCount() { return theDataList.size(); } public void deletePosition(int position){ theDataList.remove(position); notifyItemRemoved(position); notifyItemRangeChanged(position,theDataList.size()); } public void removeTheItem(){ deletePosition(getPositionBaseOnTag("my_tag")); } /***Here where I want to return the position of that Item base on TAG**/ public int getPositionBaseOnTag(String theTag){ int itemPosition; //Find the View base on TAG //Get the Position //Done return itemPosition; } } 而不是<br>)的唯一方法是end a line with two or more spaces

在IntelliJ中,我可以在<p>部分的Editor > General下通过将Other设置为Strip trailing spaces on Save来配置 - 但我找不到设置此方法的方法例如,仅None个文件的None*.mdModified Lines文件的All / *.scala

我正在使用IntelliJ Community Edition 2016.1

1 个答案:

答案 0 :(得分:2)

自IntelliJ IDEA 2016.2及更早版本开始,这是不可能的。此功能有open feature request