Scintilla Columns

I want to use spaces instead of tabs. I found this post to https://stackoverflow.com/a/1662525/2/ which seems to solve the problem. I used the accepted answer, but I still have a problem. If I hit the tab key at the beginning of a line that starts with non-spaces, the tab works correctly. However, if I click anywhere behind the line IndentWidthand press the tab key, it holds up to 8 spaces.

eg.

My IndentWidthis 2. My text ABCDEFGHI. I use periods to represent spaces.

If I click in front of the tab Aand hit, my text becomes ..ABCDEFGHI(this is correct)

If I click in front of the tab Band hit, my text becomes A.BCDEFGHI(this is correct)

If I click in front of the tab Cand hit, my text becomes AB......CDEFGHI(this is NOT correct)

Also, if the cursor is anywhere in the leading spaces of the line, when I press the tab key, the cursor moves to the first non-spatial character, and then displays the tabs.

eg.

My IndentWidthis 2. My text ....WXYZ. I use periods to represent spaces.

If I click anywhere in the first four spaces and click the tab, the cursor will move to W, and then my text will become ........WXYZ. (it is not right)

UPDATE

I forgot to mention that I specifically set the indentation properties in the code, as shown below:

scintilla.Indentation.ShowGuides = true;
scintilla.Indentation.IndentWidth = 2;
scintilla.Indentation.TabIndents = true;
scintilla.Indentation.UseTabs = false;

I just tried setting IndentWidthto 2 in the property editor during development, and now it works correctly.

: , , .

+4

Source: https://habr.com/ru/post/1526418/


All Articles