-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LaTeX: Switch handling of insert (list) environments over to snippets workflow #1330
LaTeX: Switch handling of insert (list) environments over to snippets workflow #1330
Conversation
906f9c6
to
0192e1c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
As you know I'm not LaTeX expert and so I'm wondering if it is on purpose that different environments produce quite different stylings:
\begin{block}{}
_
\end{block}
\begin{itemize}
\item _
\end{itemize}
\begin{table}
_
\end{table}
For "table" and "itemize" there is a trailing space after the cursor marker. Is this intended?
"block" uses no indentation at all, "itemize" uses a tab resp. spaces and "table" uses a single space only.
latex/src/latexutils.c
Outdated
@@ -103,6 +114,7 @@ glatex_insert_string(const gchar *string, gboolean reset_position) | |||
|
|||
doc = document_get_current(); | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this on purpose?
9313b8e
to
6728529
Compare
This is fixed. I tried to re-sync the indentions |
latex/src/latexenvironments.c
Outdated
tmpstring = g_strconcat( | ||
"\\begin{", | ||
environment, | ||
"}\n\t\\item %cursor% \n\\end{", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is still a trailing space.
5fb3c82
to
4ca8faa
Compare
Looks good now. As said before, I cannot judge whether the result of the snippets is as desired. To me it feels a little confusing that the element in the "itemize" environment is indented while for the other ones the cursor position is not indented. |
In the end it's a little matter of taste, but compare it to HTML's <ul>
<li>...</li>
</ul> and <body>
…
</body> |
This MR migrates the feature to insert any environment over to Geany's snippets workflow. Hence we don't need to bother about indention, like breaks etc. this much anymore. Also due to the cursor-feature it ensures to position the cursor at the right place , independent from the line break, indention etc.
Due to this rework it makes the code also a little more readable and fixes #1071