Skip to content

Commit

Permalink
fix strange bug
Browse files Browse the repository at this point in the history
  • Loading branch information
parnold-x committed May 30, 2020
1 parent 34a0a40 commit 4fd723a
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 3 deletions.
1 change: 1 addition & 0 deletions data/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ install_data(
'styles/language2.rng',
'styles/nasc.lang',
'styles/nasc.xml',
'styles/nasc_dark.xml',
'styles/styles.rng',
install_dir: style_dir
)
107 changes: 107 additions & 0 deletions data/styles/nasc_dark.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This theme is based on the Solarized theme originally created
by Ethan Schoonover at http://ethanschoonover.com/solarized
Copyright (C) 2012 Matthew Cantelon
Author: Matthew Cantelon <[email protected]>
GtkSourceView is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
GtkSourceView is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-->

<style-scheme id="nasc_dark" _name="NaSC Dark" version="1.0">

<author>Matthew Cantelon</author>
<_description>Adapted Solarized Dark for NaSC</_description>

<!-- Solarized Palette -->
<color name="base03" value="#95c37d"/>
<color name="base02" value="#404652"/>
<color name="base01" value="#95c37d"/>
<color name="base00" value="#a9b1bd"/>
<color name="base0" value="#777d87"/>
<color name="base1" value="#95c37d"/>
<color name="base2" value="#95c37d"/>
<color name="base3" value="#95c37d"/>
<color name="yellow" value="#e2bf90"/>
<color name="orange" value="#d2986a"/>
<color name="red" value="#e26a75"/>
<color name="magenta" value="#c775d8"/>
<color name="violet" value="#c775d8"/>
<color name="blue" value="#5daeeb"/>
<color name="cyan" value="#5daeeb"/>
<color name="green" value="#95c37d"/>
<color name="numbers" value="#5daeeb"/>
<color name="operator" value="#6e7d2a"/>
<color name="functions" value="#f37329"/>
<color name="inet" value="#47a8e9"/>

<!-- Global Settings -->
<style name="text" foreground="base00" /><!--background="base3"/>-->
<style name="selection" foreground="base1" background="base02"/>
<style name="cursor" foreground="base00"/>
<style name="current-line" background="base2"/>
<style name="line-numbers" foreground="base0" /><!--background="base2"/>-->
<style name="draw-spaces" foreground="base1"/>

<!-- Bracket Matching -->
<style name="bracket-match" foreground="red" bold="true"/>
<style name="bracket-mismatch" foreground="red" background="base3" bold="true"/>

<!-- Comments -->
<style name="def:comment" foreground="base01" italic="true"/>
<style name="def:shebang" foreground="base01" bold="true"/>
<style name="def:doc-comment-element" italic="true"/>

<!-- Right Margin -->
<style name="right-margin" foreground="base0" background="base02"/>

<!-- Search Matching -->
<style name="search-match" foreground="yellow"/>

<!-- Constants -->
<style name="def:constant" foreground="cyan"/>
<style name="def:decimal" foreground="numbers"/>
<style name="def:base-n-integer" use-style="def:decimal"/>
<style name="def:floating-point" use-style="def:decimal"/>
<style name="def:complex" use-style="def:base-n-integer"/>
<style name="def:character" foreground="magenta"/>
<style name="def:string" use-style="def:constant"/>
<style name="def:special-char" foreground="red"/>
<style name="def:builtin" foreground="functions"/>
<style name="def:keyword" foreground="magenta" bold="true"/>
<style name="def:variable" foreground="blue"/>
<style name="def:boolean" foreground="red"/>
<style name="def:special-constant" foreground="blue"/>
<style name="def:operator" foreground="operator" bold="true"/>
<!-- Identifiers -->
<style name="def:identifier" foreground="blue"/>
<style name="def:function" use-style="def:identifier"/>

<!-- Statements -->
<style name="def:statement" use-style="def:keyword"/>

<!-- Types -->
<style name="def:type" foreground="yellow"/>

<!-- Others -->
<style name="def:preprocessor" foreground="inet"/>
<style name="def:error" foreground="red" bold="true"/>
<style name="def:note" background="base02" foreground="magenta" bold="true"/>
<style name="def:underlined" foreground="violet"/>

</style-scheme>
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
project(
'com.github.parnold-x.nasc',
'vala', 'c', 'cpp',
version: '0.7.0',
version: '0.7.1',
default_options: ['cpp_std=c++11']
)

Expand Down
7 changes: 5 additions & 2 deletions src/Controller.vala
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public class Controller : Object {
GLib.Timeout.add (10, () => {
update_results.callback ();

return true;
return false;
});
yield;
}
Expand All @@ -214,6 +214,10 @@ public class Controller : Object {
for (int i = line; i < total_lines; i++) {
var line_text = line_texts[index];
if (line_text != null && check_for_calculation (line_text)) {
if (calculator.cancel.is_cancelled ()) {
calc_lock = false;
return;
}
string result = "";
calculator.calculate_store_variable.begin (
line_text, NascSettings.variable_names + "%d".printf (i),
Expand All @@ -238,7 +242,6 @@ public class Controller : Object {

if (calculator.cancel.is_cancelled ()) {
calc_lock = false;

return;
}

Expand Down

0 comments on commit 4fd723a

Please sign in to comment.